CFPropertyList 2.3.6 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +79 -0
- data/{README → README.rdoc} +0 -1
- data/lib/cfpropertylist/rbCFPropertyList.rb +1 -17
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9a51cc0e399b8e8d7719764cc9459c4f148e058c552bd97de7cda479462ce778
|
4
|
+
data.tar.gz: 5a5ffaf94e704fcd34246608fe41784b4ecc579125c874c397c34fde6e131e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce8a2387c34385c1ba660d5a0e41b3a3160a6297f8e279719b163c8c7e282a5b5ad5ab36bf287f2f056b2beb30c16c54380a98429d52cf30180426e0857faac
|
7
|
+
data.tar.gz: afc1382af071cc6560c15be4bf8670085bf0878d1006e6803dd073248055909738856ce2f73b632f56b141b98ff09aa7d85e8326bcaaad4dec8a4f1e3a19c16c
|
data/README.md
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
CFPropertyList implementation
|
2
|
+
class to read, manipulate and write both XML and binary property list
|
3
|
+
files (plist(5)) as defined by Apple. Have a look at CFPropertyList::List
|
4
|
+
for more documentation.
|
5
|
+
|
6
|
+
# Caution!
|
7
|
+
|
8
|
+
In version 3.0.0 we dropped Ruby 1.8 compatibility. If you are using
|
9
|
+
Ruby 1.8 consider to update Ruby; if you can't upgrade, don't upgrade
|
10
|
+
CFPropertyList.
|
11
|
+
|
12
|
+
# Installation
|
13
|
+
|
14
|
+
You could either use ruby gems and install it via
|
15
|
+
|
16
|
+
```bash
|
17
|
+
gem install CFPropertyList
|
18
|
+
```
|
19
|
+
|
20
|
+
or you could clone this repository and place it somewhere in your load path.
|
21
|
+
|
22
|
+
Example:
|
23
|
+
```ruby
|
24
|
+
require 'cfpropertylist'
|
25
|
+
```
|
26
|
+
|
27
|
+
If you're using Rails, you can add it into your Gemfile
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
gem 'CFPropertyList'
|
31
|
+
```
|
32
|
+
|
33
|
+
# Usage
|
34
|
+
|
35
|
+
## create a arbitrary data structure of basic data types
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
data = {
|
39
|
+
'name' => 'John Doe',
|
40
|
+
'missing' => true,
|
41
|
+
'last_seen' => Time.now,
|
42
|
+
'friends' => ['Jane Doe','Julian Doe'],
|
43
|
+
'likes' => {
|
44
|
+
'me' => false
|
45
|
+
}
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
## create CFPropertyList::List object
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
plist = CFPropertyList::List.new
|
53
|
+
```
|
54
|
+
|
55
|
+
## call CFPropertyList.guess() to create corresponding CFType values
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
plist.value = CFPropertyList.guess(data)
|
59
|
+
```
|
60
|
+
|
61
|
+
## write plist to file
|
62
|
+
```ruby
|
63
|
+
plist.save("example.plist", CFPropertyList::List::FORMAT_BINARY)
|
64
|
+
```
|
65
|
+
|
66
|
+
## … later, read it again
|
67
|
+
```ruby
|
68
|
+
plist = CFPropertyList::List.new(:file => "example.plist")
|
69
|
+
data = CFPropertyList.native_types(plist.value)
|
70
|
+
```
|
71
|
+
|
72
|
+
# Author and license
|
73
|
+
|
74
|
+
**Author:** Christian Kruse (mailto:cjk@wwwtech.de)
|
75
|
+
|
76
|
+
**Copyright:** Copyright (c) 2010
|
77
|
+
|
78
|
+
**License:** MIT License
|
79
|
+
|
data/{README → README.rdoc}
RENAMED
@@ -72,28 +72,12 @@ module CFPropertyList
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
class String
|
76
|
-
unless("".respond_to?(:bytesize)) then
|
77
|
-
def bytesize
|
78
|
-
self.length
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
75
|
dirname = File.dirname(__FILE__)
|
84
76
|
require dirname + '/rbCFPlistError.rb'
|
85
77
|
require dirname + '/rbCFTypes.rb'
|
86
78
|
require dirname + '/rbBinaryCFPropertyList.rb'
|
87
79
|
require dirname + '/rbPlainCFPropertyList.rb'
|
88
80
|
|
89
|
-
require 'iconv' unless "".respond_to?("encode")
|
90
|
-
|
91
|
-
# ensure that the module and class exist
|
92
|
-
module Enumerable
|
93
|
-
class Enumerator
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
81
|
begin
|
98
82
|
require dirname + '/rbLibXMLParser.rb'
|
99
83
|
temp = LibXML::XML::Parser::Options::NOBLANKS # check if we have a version with parser options
|
@@ -144,7 +128,7 @@ module CFPropertyList
|
|
144
128
|
when Time, DateTime, Date
|
145
129
|
CFDate.new(object)
|
146
130
|
|
147
|
-
when Array, Enumerator
|
131
|
+
when Array, Enumerator
|
148
132
|
ary = Array.new
|
149
133
|
object.each do |o|
|
150
134
|
ary.push CFPropertyList.guess(o, options)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CFPropertyList
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Kruse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -30,10 +30,11 @@ email: cjk@defunct.ch
|
|
30
30
|
executables: []
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files:
|
33
|
-
- README
|
33
|
+
- README.rdoc
|
34
34
|
files:
|
35
35
|
- LICENSE
|
36
|
-
- README
|
36
|
+
- README.md
|
37
|
+
- README.rdoc
|
37
38
|
- THANKS
|
38
39
|
- lib/cfpropertylist.rb
|
39
40
|
- lib/cfpropertylist/rbBinaryCFPropertyList.rb
|
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
version: '0'
|
65
66
|
requirements: []
|
66
67
|
rubyforge_project:
|
67
|
-
rubygems_version: 2.
|
68
|
+
rubygems_version: 2.7.3
|
68
69
|
signing_key:
|
69
70
|
specification_version: 4
|
70
71
|
summary: Read, write and manipulate both binary and XML property lists as defined
|