plist 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -0
- data/.travis.yml +16 -0
- data/{CHANGELOG → CHANGELOG.rdoc} +27 -3
- data/Gemfile +4 -0
- data/{LICENSE → LICENSE.txt} +0 -0
- data/README.rdoc +3 -0
- data/Rakefile +6 -150
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/plist.rb +3 -3
- data/lib/plist/generator.rb +5 -5
- data/lib/plist/parser.rb +30 -7
- data/lib/plist/version.rb +5 -0
- data/plist.gemspec +30 -0
- metadata +70 -36
- data/test/assets/AlbumData.xml +0 -203
- data/test/assets/Cookies.plist +0 -104
- data/test/assets/commented.plist +0 -9
- data/test/assets/example_data.bin +0 -0
- data/test/assets/example_data.jpg +0 -0
- data/test/assets/example_data.plist +0 -259
- data/test/assets/test_data_elements.plist +0 -26
- data/test/assets/test_empty_key.plist +0 -13
- data/test/test_data_elements.rb +0 -124
- data/test/test_generator.rb +0 -75
- data/test/test_generator_basic_types.rb +0 -53
- data/test/test_generator_collections.rb +0 -77
- data/test/test_parser.rb +0 -97
Binary file
|
Binary file
|
@@ -1,259 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
-
<plist version="1.0">
|
4
|
-
<dict>
|
5
|
-
<key>IMs</key>
|
6
|
-
<array>
|
7
|
-
<string>com.apple.syncservices:9583BE42-EC1A-4B3F-B248-7904BA60634B</string>
|
8
|
-
<string>com.apple.syncservices:2A222E96-4CC6-4320-BE0C-61D5F08C2E64</string>
|
9
|
-
<string>com.apple.syncservices:64DAA772-4558-49F8-9B87-C4A32D5E05C1</string>
|
10
|
-
<string>com.apple.syncservices:AF7C6884-B760-4E55-A4D5-B1B114C8A7DC</string>
|
11
|
-
<string>com.apple.syncservices:ECC7FAED-47D6-4DB9-8120-2F029C7D64C8</string>
|
12
|
-
<string>com.apple.syncservices:D704F079-F869-4613-9CFC-697C1976E8F4</string>
|
13
|
-
</array>
|
14
|
-
<key>URLs</key>
|
15
|
-
<array>
|
16
|
-
<string>com.apple.syncservices:5BA97109-F8E3-46A9-AF0B-5F8C093F49EA</string>
|
17
|
-
</array>
|
18
|
-
<key>com.apple.syncservices.RecordEntityName</key>
|
19
|
-
<string>com.apple.contacts.Contact</string>
|
20
|
-
<key>display as company</key>
|
21
|
-
<string>person</string>
|
22
|
-
<key>email addresses</key>
|
23
|
-
<array>
|
24
|
-
<string>com.apple.syncservices:B97DCC9C-5B00-4D38-AB06-4B7A5D6BC369</string>
|
25
|
-
<string>com.apple.syncservices:E508D679-43E1-49E2-B5D7-F14A8E48C067</string>
|
26
|
-
<string>com.apple.syncservices:C6478063-34A5-4CCB-BD41-1F131D56F7BD</string>
|
27
|
-
<string>com.apple.syncservices:2B3E352C-7831-4349-9A87-0FA4BD290515</string>
|
28
|
-
</array>
|
29
|
-
<key>first name</key>
|
30
|
-
<string>Mat</string>
|
31
|
-
<key>image</key>
|
32
|
-
<data>
|
33
|
-
/9j/4AAQSkZJRgABAQAAAQABAAD/7QAcUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAD/
|
34
|
-
4g9ASUNDX1BST0ZJTEUAAQEAAA8wYXBwbAIAAABtbnRyUkdCIFhZWiAH1gAFABUAFAAg
|
35
|
-
AAZhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGxx
|
36
|
-
EHyAeZ4fvAacU+DW7cbVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5yWFla
|
37
|
-
AAABLAAAABRnWFlaAAABQAAAABRiWFlaAAABVAAAABR3dHB0AAABaAAAABRjaGFkAAAB
|
38
|
-
fAAAACxyVFJDAAABqAAAAA5nVFJDAAABuAAAAA5iVFJDAAAByAAAAA52Y2d0AAAB2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9k=
|
220
|
-
</data>
|
221
|
-
<key>last name</key>
|
222
|
-
<string>Schaffer</string>
|
223
|
-
<key>phone numbers</key>
|
224
|
-
<array>
|
225
|
-
<string>com.apple.syncservices:64ED42EB-109B-43A9-BEFC-3463D944251A</string>
|
226
|
-
<string>com.apple.syncservices:FB7585EB-A3DE-46D5-920C-DF8028689BC5</string>
|
227
|
-
<string>com.apple.syncservices:020036FD-22B3-41C9-BC3D-CDA6083582C6</string>
|
228
|
-
<string>com.apple.syncservices:C6661518-90CA-45C7-A988-02F73B958951</string>
|
229
|
-
</array>
|
230
|
-
<key>primary URL</key>
|
231
|
-
<array>
|
232
|
-
<string>com.apple.syncservices:5BA97109-F8E3-46A9-AF0B-5F8C093F49EA</string>
|
233
|
-
</array>
|
234
|
-
<key>primary email address</key>
|
235
|
-
<array>
|
236
|
-
<string>com.apple.syncservices:B97DCC9C-5B00-4D38-AB06-4B7A5D6BC369</string>
|
237
|
-
</array>
|
238
|
-
<key>primary phone number</key>
|
239
|
-
<array>
|
240
|
-
<string>com.apple.syncservices:64ED42EB-109B-43A9-BEFC-3463D944251A</string>
|
241
|
-
</array>
|
242
|
-
<key>primary related name</key>
|
243
|
-
<array>
|
244
|
-
<string>com.apple.syncservices:CD0B7021-0228-4770-8FB0-3739479E9788</string>
|
245
|
-
</array>
|
246
|
-
<key>primary street address</key>
|
247
|
-
<array>
|
248
|
-
<string>com.apple.syncservices:377B9105-9D15-4F69-BCD6-B01E587F7760</string>
|
249
|
-
</array>
|
250
|
-
<key>related names</key>
|
251
|
-
<array>
|
252
|
-
<string>com.apple.syncservices:CD0B7021-0228-4770-8FB0-3739479E9788</string>
|
253
|
-
</array>
|
254
|
-
<key>street addresses</key>
|
255
|
-
<array>
|
256
|
-
<string>com.apple.syncservices:377B9105-9D15-4F69-BCD6-B01E587F7760</string>
|
257
|
-
</array>
|
258
|
-
</dict>
|
259
|
-
</plist>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
-
<plist version="1.0">
|
4
|
-
<dict>
|
5
|
-
<key>stringio</key>
|
6
|
-
<data>dGhpcyBpcyBhIHN0cmluZ2lvIG9iamVjdA==
|
7
|
-
</data>
|
8
|
-
<key>file</key>
|
9
|
-
<data>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
10
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
11
|
-
AAAAAAAAAAAAAA==
|
12
|
-
</data>
|
13
|
-
<key>io</key>
|
14
|
-
<data>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
15
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
16
|
-
AAAAAAAAAAAAAA==
|
17
|
-
</data>
|
18
|
-
<key>marshal</key>
|
19
|
-
<!-- The <data> element below contains a Ruby object which has been serialized with Marshal.dump. -->
|
20
|
-
<data>BAhvOhZNYXJzaGFsYWJsZU9iamVjdAY6CUBmb28iHnRoaXMgb2JqZWN0IHdh
|
21
|
-
cyBtYXJzaGFsZWQ=
|
22
|
-
</data>
|
23
|
-
<key>nodata</key>
|
24
|
-
<data/>
|
25
|
-
</dict>
|
26
|
-
</plist>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
-
<plist version="1.0">
|
4
|
-
<dict>
|
5
|
-
<key>key</key>
|
6
|
-
<dict>
|
7
|
-
<key></key>
|
8
|
-
<string>1</string>
|
9
|
-
<key>subkey</key>
|
10
|
-
<string>2</string>
|
11
|
-
</dict>
|
12
|
-
</dict>
|
13
|
-
</plist>
|
data/test/test_data_elements.rb
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'plist'
|
5
|
-
require 'stringio'
|
6
|
-
|
7
|
-
class MarshalableObject
|
8
|
-
attr_accessor :foo
|
9
|
-
|
10
|
-
def initialize(str)
|
11
|
-
@foo = str
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class TestDataElements < Test::Unit::TestCase
|
16
|
-
|
17
|
-
def setup
|
18
|
-
@result = Plist.parse_xml( 'test/assets/test_data_elements.plist' )
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_data_object_header
|
22
|
-
expected = <<END
|
23
|
-
<!-- The <data> element below contains a Ruby object which has been serialized with Marshal.dump. -->
|
24
|
-
<data>
|
25
|
-
BAhvOhZNYXJzaGFsYWJsZU9iamVjdAY6CUBmb28iHnRoaXMgb2JqZWN0IHdhcyBtYXJz
|
26
|
-
aGFsZWQ=
|
27
|
-
</data>
|
28
|
-
END
|
29
|
-
expected_elements = expected.chomp.split( "\n" )
|
30
|
-
|
31
|
-
actual = Plist::Emit.dump( Object.new, false )
|
32
|
-
actual_elements = actual.chomp.split( "\n" )
|
33
|
-
|
34
|
-
# check for header
|
35
|
-
assert_equal expected_elements.shift, actual_elements.shift
|
36
|
-
|
37
|
-
# check for opening and closing data tags
|
38
|
-
assert_equal expected_elements.shift, actual_elements.shift
|
39
|
-
assert_equal expected_elements.pop, actual_elements.pop
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_marshal_round_trip
|
43
|
-
expected = MarshalableObject.new('this object was marshaled')
|
44
|
-
actual = Plist.parse_xml( Plist::Emit.dump(expected, false) )
|
45
|
-
|
46
|
-
assert_kind_of expected.class, actual
|
47
|
-
assert_equal expected.foo, actual.foo
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_generator_io_and_file
|
51
|
-
expected = <<END
|
52
|
-
<data>
|
53
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
54
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
|
55
|
-
</data>
|
56
|
-
END
|
57
|
-
|
58
|
-
expected.chomp!
|
59
|
-
|
60
|
-
fd = IO.sysopen('test/assets/example_data.bin')
|
61
|
-
io = IO.open(fd, 'r')
|
62
|
-
|
63
|
-
# File is a subclass of IO, so catching IO in the dispatcher should work for File as well...
|
64
|
-
f = File.open('test/assets/example_data.bin')
|
65
|
-
|
66
|
-
assert_equal expected, Plist::Emit.dump(io, false).chomp
|
67
|
-
assert_equal expected, Plist::Emit.dump(f, false).chomp
|
68
|
-
|
69
|
-
assert_instance_of StringIO, @result['io']
|
70
|
-
assert_instance_of StringIO, @result['file']
|
71
|
-
|
72
|
-
io.rewind
|
73
|
-
f.rewind
|
74
|
-
|
75
|
-
assert_equal io.read, @result['io'].read
|
76
|
-
assert_equal f.read, @result['file'].read
|
77
|
-
|
78
|
-
io.close
|
79
|
-
f.close
|
80
|
-
end
|
81
|
-
|
82
|
-
def test_generator_string_io
|
83
|
-
expected = <<END
|
84
|
-
<data>
|
85
|
-
dGhpcyBpcyBhIHN0cmluZ2lvIG9iamVjdA==
|
86
|
-
</data>
|
87
|
-
END
|
88
|
-
|
89
|
-
sio = StringIO.new('this is a stringio object')
|
90
|
-
|
91
|
-
assert_equal expected.chomp, Plist::Emit.dump(sio, false).chomp
|
92
|
-
|
93
|
-
assert_instance_of StringIO, @result['stringio']
|
94
|
-
|
95
|
-
sio.rewind
|
96
|
-
assert_equal sio.read, @result['stringio'].read
|
97
|
-
end
|
98
|
-
|
99
|
-
# this functionality is credited to Mat Schaffer,
|
100
|
-
# who discovered the plist with the data tag
|
101
|
-
# supplied the test data, and provided the parsing code.
|
102
|
-
def test_data
|
103
|
-
# test reading plist <data> elements
|
104
|
-
data = Plist::parse_xml("test/assets/example_data.plist");
|
105
|
-
assert_equal( File.open("test/assets/example_data.jpg"){|f| f.read }, data['image'].read )
|
106
|
-
|
107
|
-
# test writing data elements
|
108
|
-
expected = File.read("test/assets/example_data.plist")
|
109
|
-
result = data.to_plist
|
110
|
-
#File.open('result.plist', 'w') {|f|f.write(result)} # debug
|
111
|
-
assert_equal( expected, result )
|
112
|
-
|
113
|
-
# Test changing the <data> object in the plist to a StringIO and writing.
|
114
|
-
# This appears extraneous given that plist currently returns a StringIO,
|
115
|
-
# so the above writing test also flexes StringIO#to_plist_node.
|
116
|
-
# However, the interface promise is to return an IO, not a particular class.
|
117
|
-
# plist used to return Tempfiles, which was changed solely for performance reasons.
|
118
|
-
data['image'] = StringIO.new( File.read("test/assets/example_data.jpg"))
|
119
|
-
|
120
|
-
assert_equal(expected, data.to_plist )
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
data/test/test_generator.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'plist'
|
5
|
-
|
6
|
-
class SerializableObject
|
7
|
-
attr_accessor :foo
|
8
|
-
|
9
|
-
def initialize(str)
|
10
|
-
@foo = str
|
11
|
-
end
|
12
|
-
|
13
|
-
def to_plist_node
|
14
|
-
return "<string>#{CGI::escapeHTML @foo}</string>"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
class TestGenerator < Test::Unit::TestCase
|
19
|
-
def test_to_plist_vs_plist_emit_dump_no_envelope
|
20
|
-
source = [1, :b, true]
|
21
|
-
|
22
|
-
to_plist = source.to_plist(false)
|
23
|
-
plist_emit_dump = Plist::Emit.dump(source, false)
|
24
|
-
|
25
|
-
assert_equal to_plist, plist_emit_dump
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_to_plist_vs_plist_emit_dump_with_envelope
|
29
|
-
source = [1, :b, true]
|
30
|
-
|
31
|
-
to_plist = source.to_plist
|
32
|
-
plist_emit_dump = Plist::Emit.dump(source)
|
33
|
-
|
34
|
-
assert_equal to_plist, plist_emit_dump
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_dumping_serializable_object
|
38
|
-
str = 'this object implements #to_plist_node'
|
39
|
-
so = SerializableObject.new(str)
|
40
|
-
|
41
|
-
assert_equal "<string>#{str}</string>", Plist::Emit.dump(so, false)
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_write_plist
|
45
|
-
data = [1, :two, {:c => 'dee'}]
|
46
|
-
|
47
|
-
data.save_plist('test.plist')
|
48
|
-
file = File.open('test.plist') {|f| f.read}
|
49
|
-
|
50
|
-
assert_equal file, data.to_plist
|
51
|
-
|
52
|
-
File.unlink('test.plist')
|
53
|
-
end
|
54
|
-
|
55
|
-
# The hash in this test was failing with 'hsh.keys.sort',
|
56
|
-
# we are making sure it works with 'hsh.keys.sort_by'.
|
57
|
-
def test_sorting_keys
|
58
|
-
hsh = {:key1 => 1, :key4 => 4, 'key2' => 2, :key3 => 3}
|
59
|
-
output = Plist::Emit.plist_node(hsh)
|
60
|
-
expected = <<-STR
|
61
|
-
<dict>
|
62
|
-
<key>key1</key>
|
63
|
-
<integer>1</integer>
|
64
|
-
<key>key2</key>
|
65
|
-
<integer>2</integer>
|
66
|
-
<key>key3</key>
|
67
|
-
<integer>3</integer>
|
68
|
-
<key>key4</key>
|
69
|
-
<integer>4</integer>
|
70
|
-
</dict>
|
71
|
-
STR
|
72
|
-
|
73
|
-
assert_equal expected, output.gsub(/[\t]/, "\s\s")
|
74
|
-
end
|
75
|
-
end
|