Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

CFPropertyList

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

CFPropertyList

  • 3.0.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CFPropertyList implementation class to read, manipulate and write both XML and binary property list files (plist(5)) as defined by Apple. Have a look at CFPropertyList::List for more documentation.

Caution!

In version 3.0.0 we dropped Ruby 1.8 compatibility. If you are using Ruby 1.8 consider to update Ruby; if you can't upgrade, don't upgrade CFPropertyList.

Installation

You could either use ruby gems and install it via

gem install CFPropertyList

or you could clone this repository and place it somewhere in your load path.

Example:

require 'cfpropertylist'

If you're using Rails, you can add it into your Gemfile

gem 'CFPropertyList'

Usage

create a arbitrary data structure of basic data types

data = {
  'name' => 'John Doe',
  'missing' => true,
  'last_seen' => Time.now,
  'friends' => ['Jane Doe','Julian Doe'],
  'likes' => {
    'me' => false
  }
}

create CFPropertyList::List object

plist = CFPropertyList::List.new

call CFPropertyList.guess() to create corresponding CFType values

plist.value = CFPropertyList.guess(data)

write plist to file

plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY)

… later, read it again

plist = CFPropertyList::List.new(:file => "example.plist")
data = CFPropertyList.native_types(plist.value)

Author and license

Author: Christian Kruse (mailto:cjk@wwwtech.de)

Copyright: Copyright (c) 2010

License: MIT License

FAQs

Package last updated on 15 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc