plist 3.1.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+
3
+ module Plist
4
+ VERSION = '3.6.0'.freeze
5
+ end
metadata CHANGED
@@ -1,87 +1,92 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: plist
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 3
7
- - 1
8
- - 0
9
- version: 3.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.6.0
10
5
  platform: ruby
11
- authors:
12
- - Ben Bleything and Patrick May
13
- autorequire: plist
6
+ authors:
7
+ - Ben Bleything
8
+ - Patrick May
9
+ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-02-23 00:00:00 -08:00
18
- default_executable:
19
- dependencies: []
20
-
21
- description: |
22
- Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.
23
-
24
- email:
12
+ date: 2020-12-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '1.14'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '1.14'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '10.5'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '10.5'
42
+ - !ruby/object:Gem::Dependency
43
+ name: test-unit
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.2'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.2'
56
+ description: Plist is a library to manipulate Property List files, also known as plists.
57
+ It can parse plist files into native Ruby data structures as well as generating
58
+ new plist files from your Ruby objects.
59
+ email:
25
60
  executables: []
26
-
27
61
  extensions: []
28
-
29
62
  extra_rdoc_files: []
30
-
31
- files:
32
- - Rakefile
33
- - README.rdoc
34
- - CHANGELOG
35
- - LICENSE
63
+ files:
64
+ - LICENSE.txt
65
+ - lib/plist.rb
36
66
  - lib/plist/generator.rb
37
67
  - lib/plist/parser.rb
38
- - lib/plist.rb
39
- - test/test_data_elements.rb
40
- - test/test_generator.rb
41
- - test/test_generator_basic_types.rb
42
- - test/test_generator_collections.rb
43
- - test/test_parser.rb
44
- - test/assets/AlbumData.xml
45
- - test/assets/commented.plist
46
- - test/assets/Cookies.plist
47
- - test/assets/example_data.bin
48
- - test/assets/example_data.jpg
49
- - test/assets/example_data.plist
50
- - test/assets/test_data_elements.plist
51
- - test/assets/test_empty_key.plist
52
- has_rdoc: true
53
- homepage: http://plist.rubyforge.org
54
- licenses: []
55
-
56
- post_install_message:
68
+ - lib/plist/version.rb
69
+ homepage: https://github.com/patsplat/plist
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
57
74
  rdoc_options: []
58
-
59
- require_paths:
75
+ require_paths:
60
76
  - lib
61
- required_ruby_version: !ruby/object:Gem::Requirement
62
- requirements:
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
63
79
  - - ">="
64
- - !ruby/object:Gem::Version
65
- segments:
66
- - 0
67
- version: "0"
68
- required_rubygems_version: !ruby/object:Gem::Requirement
69
- requirements:
80
+ - !ruby/object:Gem::Version
81
+ version: 1.9.3
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
70
84
  - - ">="
71
- - !ruby/object:Gem::Version
72
- segments:
73
- - 0
74
- version: "0"
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
75
87
  requirements: []
76
-
77
- rubyforge_project: plist
78
- rubygems_version: 1.3.6
79
- signing_key:
80
- specification_version: 3
81
- summary: All-purpose Property List manipulation library.
82
- test_files:
83
- - test/test_data_elements.rb
84
- - test/test_generator.rb
85
- - test/test_generator_basic_types.rb
86
- - test/test_generator_collections.rb
87
- - test/test_parser.rb
88
+ rubygems_version: 3.2.3
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: All-purpose Property List manipulation library
92
+ test_files: []
data/CHANGELOG DELETED
@@ -1,103 +0,0 @@
1
- = plist - All-purpose Property List manipulation library
2
-
3
- === Release version 3.0.0!
4
-
5
- 2010-02-23:
6
- * Ruby 1.9.x compatibility!
7
-
8
- 2010-02-16:
9
- * excise a bunch of unnecessary @@ variables
10
- * fix up some tests for cross-version compatibility
11
-
12
- 2010-02-14:
13
- * generalized cleanup:
14
- * fix old file headers
15
- * modernize rakefile
16
- * clean up rdoc
17
-
18
- 2010-01-08:
19
- * move from RubyForge Subversion to GitHub
20
-
21
- 2007-02-22 (r81):
22
- * make the plist parser accept strings contain XML or any object that responds to #read (File and StringIO being the intended targets here). Test and idea contributed by Chuck Remes.
23
-
24
- 2006-09-20 (r80):
25
- * tweak a comment in generator.rb to make it clear that we're not using Base64.b64encode because it's broken.
26
-
27
- === Release version 3.0.0!
28
-
29
- 2006-09-20 (r77 - r79):
30
- * move IndentedString inside Plist::Emit and :nodoc: it
31
- * Tag 3.0.0! (from rev 78)
32
-
33
- 2006-09-19 (r73 - r75):
34
- * Really fix the rakefile this time (apparently I deleted some code that I needed...)
35
- * alter the fix_whitespace rake task to ignore the assets directory
36
- * cleanup whitespace
37
-
38
- 2006-09-18 (r70 - r72):
39
- * Update this file ;)
40
- * Fix Rakefile
41
- * gem install -t now works correctly
42
- * Remove super-sekr1t rdoc staging area from rdoc publishing task
43
-
44
- 2006-09-15 (r64 - r69):
45
- * Change behavior of empty collection elements to match What Apple Does
46
- * Fix some gem packaging infrastructure
47
-
48
- 2006-09-13 (r61 - r63):
49
- * Merge generator injection removal branch into trunk!
50
-
51
- 2006-09-13 (r52 - r60):
52
- * Fix indentation/newlines in generator (finally!)
53
- * Refix indentation to be more faithful to the way Apple emits their plists
54
- * Remove horrific regex and replace it with proper comment parsing
55
- * Empty plists return nil when parsed
56
- * Sort hash keys before emitting (now we can test multi-element hashes!)
57
- * Inject #<=> into Symbol so that sorting Symbol-keyed hashes won't freak out
58
-
59
- 2006-09-12 (r47 - r51):
60
- * More test rejiggering
61
- * New tests to expose some bugs
62
-
63
- 2006-09-10 (r33 - r46):
64
- * Update tests for new generator code
65
- * Rejigger some tests
66
- * Make the generator try to call #to_plist_node on any object it tries to serialize, thus allowing class authors to define how their objects will be serialized
67
- * Marshal.dump unrecognized objects into <data> elements
68
- * Make the parser strip out comments and Marshal.load <data> elements if possible
69
- * Update some rdoc
70
-
71
- === Release version 2.1.1!
72
-
73
- 2006-09-10 (r31 - r32):
74
- * Added encoding / decoding for entities (&amp; etc)
75
- * Changed parsing of <data> elements to return StringIO objects
76
- * Fixed bug with empty <key> tags
77
-
78
- 2006-08-24 (r25 - r30):
79
- * Invert ownership of methods in the generator, allowing us to remove the self.extend(self)
80
- * New branch to remove method inject from parser
81
-
82
- 2006-08-23 (r22 - r24):
83
- * Add rcov task to Rakefile
84
- * Add some tests
85
-
86
- 2006-08-20 (r9 - r21):
87
- * Add a bunch of rdoc and rdoc infrastructure
88
- * Add rake task to clean up errant whitespace
89
- * Spin off a branch to remove a bunch of method injection in the generator code
90
- * Rename some tests for clarity's sake
91
- * Replace NARF generation code with Ben's generation code
92
- * Update tests
93
- * This broke indentation (will be fixed later)
94
- * Add Plist::Emit.dump, so you can dump objects which don't include Plist::Emit, update tests to match
95
- * Fix a bug with the method that wraps output in the plist header/footer
96
-
97
- 2006-08-19 (r1 - r8):
98
- * The beginnings of merging the plist project into the NARF plist library (under the plist project's name)
99
- * fancier project infrastructure (more tests, Rakefile, the like)
100
- * Add/update copyright notices in the source files
101
- * Move a bunch of documentation out to README
102
- * Split library into chunks
103
- * Properly delete files when cleaning up from tests
@@ -1,158 +0,0 @@
1
- = All-purpose Property List manipulation library
2
-
3
- Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.
4
-
5
- == Usage
6
-
7
- === Parsing
8
-
9
- result = Plist::parse_xml('path/to/example.plist')
10
-
11
- result.class
12
- => Hash
13
-
14
- "#{result['FirstName']} #{result['LastName']}"
15
- => "John Public"
16
-
17
- result['ZipPostal']
18
- => "12345"
19
-
20
- ==== Example Property List
21
-
22
- <?xml version="1.0" encoding="UTF-8"?>
23
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
24
- <plist version="1.0">
25
- <dict>
26
- <key>FirstName</key>
27
- <string>John</string>
28
-
29
- <key>LastName</key>
30
- <string>Public</string>
31
-
32
- <key>StreetAddr1</key>
33
- <string>123 Anywhere St.</string>
34
-
35
- <key>StateProv</key>
36
- <string>CA</string>
37
-
38
- <key>City</key>
39
- <string>Some Town</string>
40
-
41
- <key>CountryName</key>
42
- <string>United States</string>
43
-
44
- <key>AreaCode</key>
45
- <string>555</string>
46
-
47
- <key>LocalPhoneNumber</key>
48
- <string>5551212</string>
49
-
50
- <key>ZipPostal</key>
51
- <string>12345</string>
52
- </dict>
53
- </plist>
54
-
55
- === Generation
56
-
57
- plist also provides the ability to generate plists from Ruby objects. The following Ruby classes are converted into native plist types:
58
- Array, Bignum, Date, DateTime, Fixnum, Float, Hash, Integer, String, Symbol, Time, true, false
59
-
60
- * +Array+ and +Hash+ are both recursive; their elements will be converted into plist nodes inside the <array> and <dict> containers (respectively).
61
- * +IO+ (and its descendants) and +StringIO+ objects are read from and their contents placed in a <data> element.
62
- * User classes may implement +to_plist_node+ to dictate how they should be serialized; otherwise the object will be passed to <tt>Marshal.dump</tt> and the result placed in a <data> element. See below for more details.
63
-
64
- ==== Creating a plist
65
-
66
- There are two ways to generate complete plists. Given an object:
67
-
68
- obj = [1, :two, {'c' => 0xd}]
69
-
70
- If you've mixed in <tt>Plist::Emit</tt> (which is already done for +Array+ and +Hash+), you can simply call +to_plist+:
71
-
72
- obj.to_plist
73
-
74
- This is equivalent to calling <tt>Plist::Emit.dump(obj)</tt>. Either one will yield:
75
-
76
- <?xml version="1.0" encoding="UTF-8"?>
77
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
78
- <plist version="1.0">
79
- <array>
80
- <integer>1</integer>
81
- <string>two</string>
82
- <dict>
83
- <key>c</key>
84
- <integer>13</integer>
85
- </dict>
86
- </array>
87
- </plist>
88
-
89
- You can also dump plist fragments by passing +false+ as the second parameter:
90
-
91
- Plist::Emit.dump('holy cow!', false)
92
- => "<string>holy cow!</string>"
93
-
94
- ==== Custom serialization
95
-
96
- If your class can be safely coerced into a native plist datatype, you can implement +to_plist_node+. Upon encountering an object of a class it doesn't recognize, the plist library will check to see if it responds to +to_plist_node+, and if so, insert the result of that call into the plist output.
97
-
98
- An example:
99
-
100
- class MyFancyString
101
- ...
102
-
103
- def to_plist_node
104
- return "<string>#{self.defancify}</string>"
105
- end
106
- end
107
-
108
- When you attempt to serialize a +MyFancyString+ object, the +to_plist_node+ method will be called and the object's contents will be defancified and placed in the plist.
109
-
110
- If for whatever reason you can't add this method, your object will be serialized with <tt>Marshal.dump</tt> instead.
111
-
112
- == Links
113
-
114
- [Project Page] http://plist.rubyforge.org
115
- [GitHub] http://github.com/bleything/plist
116
- [RDoc] http://plist.rubyforge.org
117
-
118
- == Credits
119
-
120
- plist is maintained by Ben Bleything <mailto:ben@bleything.net> and Patrick May <mailto:patrick@hexane.org>. Patrick wrote most of the code; Ben is a recent addition to the project, having merged in his plist generation library.
121
-
122
- Other folks who have helped along the way:
123
-
124
- [<b>Martin Dittus</b>] who pointed out that +Time+ wasn't enough for plist <tt>Dates</tt>, especially those in <tt>~/Library/Cookies/Cookies.plist</tt>
125
- [<b>Chuck Remes</b>] who pushed Patrick towards implementing <tt>#to_plist</tt>
126
- [<b>Mat Schaffer</b>] who supplied code and test cases for <tt><data></tt> elements
127
- [<b>Michael Granger</b>] for encouragement and help
128
- [<b>Carsten Bormann, Chris Hoffman, Dana Contreras, Hongli Lai, Johan Sørensen</b>] for contributing Ruby 1.9.x compatibility fixes
129
-
130
- == License and Copyright
131
-
132
- plist is released under the MIT License.
133
-
134
- Portions of the code (notably the Rakefile) contain code pulled and/or adapted from other projects. These files contain a comment at the top describing what was used.
135
-
136
- === MIT License
137
-
138
- Copyright (c) 2006-2010, Ben Bleything <ben@bleything.net> and Patrick May <patrick@hexane.org>
139
-
140
- Permission is hereby granted, free of charge, to any person obtaining
141
- a copy of this software and associated documentation files (the
142
- "Software"), to deal in the Software without restriction, including
143
- without limitation the rights to use, copy, modify, merge, publish,
144
- distribute, sublicense, and/or sell copies of the Software, and to
145
- permit persons to whom the Software is furnished to do so, subject to
146
- the following conditions:
147
-
148
- The above copyright notice and this permission notice shall be included
149
- in all copies or substantial portions of the Software.
150
-
151
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
152
- KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
153
- WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
154
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
155
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
156
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
157
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
158
-
data/Rakefile DELETED
@@ -1,148 +0,0 @@
1
- #
2
- # Plist Rakefile
3
- #
4
- # Based heavily on Geoffrey Grosenbach's Rakefile for gruff.
5
- # Includes whitespace-fixing task based on code from Typo.
6
- #
7
- # Copyright 2006-2010 Ben Bleything and Patrick May
8
- # Distributed under the MIT License
9
- #
10
-
11
- require 'fileutils'
12
- require 'rubygems'
13
- require 'rake'
14
- require 'rake/testtask'
15
- require 'rake/packagetask'
16
- require 'rake/gempackagetask'
17
- require 'rake/contrib/rubyforgepublisher'
18
- require 'rdoc/task'
19
-
20
- $:.unshift(File.dirname(__FILE__) + "/lib")
21
- require 'plist'
22
-
23
- PKG_NAME = 'plist'
24
- PKG_VERSION = Plist::VERSION
25
- PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
26
-
27
- RELEASE_NAME = "REL #{PKG_VERSION}"
28
-
29
- RUBYFORGE_PROJECT = "plist"
30
- RUBYFORGE_USER = ENV['RUBYFORGE_USER']
31
-
32
- TEST_FILES = Dir.glob('test/test_*')
33
- TEST_ASSETS = Dir.glob('test/assets/*')
34
- LIB_FILES = Dir.glob('lib/**/*')
35
- RELEASE_FILES = [ "Rakefile", "README.rdoc", "CHANGELOG", "LICENSE" ] + LIB_FILES + TEST_FILES + TEST_ASSETS
36
-
37
- task :default => [ :test ]
38
- # Run the unit tests
39
- Rake::TestTask.new { |t|
40
- t.libs << "test"
41
- t.pattern = 'test/test_*.rb'
42
- t.verbose = true
43
- }
44
-
45
- desc "Clean pkg, coverage, and rdoc; remove .bak files"
46
- task :clean => [ :clobber_rdoc, :clobber_package, :clobber_coverage ] do
47
- puts cmd = "find . -type f -name *.bak -delete"
48
- `#{cmd}`
49
- end
50
-
51
- task :clobber_coverage do
52
- puts cmd = "rm -rf coverage"
53
- `#{cmd}`
54
- end
55
-
56
- desc "Generate coverage analysis with rcov (requires rcov to be installed)"
57
- task :rcov => [ :clobber_coverage ] do
58
- puts cmd = "rcov -Ilib --xrefs -T test/*.rb"
59
- puts `#{cmd}`
60
- end
61
-
62
- desc "Strip trailing whitespace and fix newlines for all release files"
63
- task :fix_whitespace => [ :clean ] do
64
- RELEASE_FILES.reject {|i| i =~ /assets/}.each do |filename|
65
- next if File.directory? filename
66
-
67
- File.open(filename) do |file|
68
- newfile = ''
69
- needs_love = false
70
-
71
- file.readlines.each_with_index do |line, lineno|
72
- if line =~ /[ \t]+$/
73
- needs_love = true
74
- puts "#{filename}: trailing whitespace on line #{lineno}"
75
- line.gsub!(/[ \t]*$/, '')
76
- end
77
-
78
- if line.chomp == line
79
- needs_love = true
80
- puts "#{filename}: no newline on line #{lineno}"
81
- line << "\n"
82
- end
83
-
84
- newfile << line
85
- end
86
-
87
- if needs_love
88
- tempname = "#{filename}.new"
89
-
90
- File.open(tempname, 'w').write(newfile)
91
- File.chmod(File.stat(filename).mode, tempname)
92
-
93
- FileUtils.ln filename, "#{filename}.bak"
94
- FileUtils.ln tempname, filename, :force => true
95
- File.unlink(tempname)
96
- end
97
- end
98
- end
99
- end
100
-
101
- desc "Copy documentation to rubyforge"
102
- task :update_rdoc => [ :rdoc ] do
103
- Rake::SshDirPublisher.new("#{RUBYFORGE_USER}@rubyforge.org", "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}", "rdoc").upload
104
- end
105
-
106
- # Genereate the RDoc documentation
107
- RDoc::Task.new do |rdoc|
108
- rdoc.title = "All-purpose Property List manipulation library"
109
- rdoc.main = "README.rdoc"
110
-
111
- rdoc.rdoc_dir = 'rdoc'
112
- rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG')
113
- rdoc.rdoc_files.include('lib/**')
114
-
115
- rdoc.options = [
116
- '-H', # show hash marks on method names in comments
117
- '-N', # show line numbers
118
- ]
119
- end
120
-
121
- # Create compressed packages
122
- spec = Gem::Specification.new do |s|
123
- s.name = PKG_NAME
124
- s.version = PKG_VERSION
125
-
126
- s.summary = "All-purpose Property List manipulation library."
127
- s.description = <<-EOD
128
- Plist is a library to manipulate Property List files, also known as plists. It can parse plist files into native Ruby data structures as well as generating new plist files from your Ruby objects.
129
- EOD
130
-
131
- s.authors = "Ben Bleything and Patrick May"
132
- s.homepage = "http://plist.rubyforge.org"
133
-
134
- s.rubyforge_project = RUBYFORGE_PROJECT
135
-
136
- s.has_rdoc = true
137
-
138
- s.files = RELEASE_FILES
139
- s.test_files = TEST_FILES
140
-
141
- s.autorequire = 'plist'
142
- end
143
-
144
- Rake::GemPackageTask.new(spec) do |p|
145
- p.gem_spec = spec
146
- p.need_tar = true
147
- p.need_zip = true
148
- end