plist 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5fa8e33a6700467ad3d91f7513275c19e020433e4e66b9df83020e38d04c24b
4
- data.tar.gz: 2c588eb552e98c74d99b47138434e09a4dc3965857f2a9eb6af84fa14926b2ff
3
+ metadata.gz: 5dada9257510eabf5ab04f5bd4dd6098a33ce68142d3c63c6278c643630a7761
4
+ data.tar.gz: f45363442af85f0515c7d30d25a3ca8625f366a91110334c4b2db7717ce9fa98
5
5
  SHA512:
6
- metadata.gz: 4600738237509772e5a8a9299b370e8a3c611e5b5540a40889c4623a5e88c080515f177c2e74e49cf93a29df36afd9097da9787aa82d40af14f75fd076e5c68b
7
- data.tar.gz: bf5f666db425a2b664fdbba0b81ae14d38a4d88035ca7a29b66c35bfb9b87defe3216b0bc1cc67e5c960f174ad97b2e47b290cc86aaca56cffc4e325265d43e2
6
+ metadata.gz: cfe9ad984a22f43d24802fc159fca5e53d4ac88e45610d5accb0cafcfcecf99a643d290ed4073147e32f1f34b1c84b1ed8745b1d1c30edc8dc3c0fdc7d225efd
7
+ data.tar.gz: 91744b0fd7d45ccc1adff2f5279c37a511725896479e4a20261605735067e518f5eb5354605567a796aba2a78724555389b09b162d7218c363759df85d1dcce3
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Plist
4
- VERSION = '3.4.0'.freeze
4
+ VERSION = '3.5.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plist
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Bleything
8
8
  - Patrick May
9
9
  autorequire:
10
- bindir: exe
10
+ bindir: bin
11
11
  cert_chain: []
12
- date: 2017-12-09 00:00:00.000000000 Z
12
+ date: 2018-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -61,20 +61,11 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
- - ".gitignore"
65
- - ".travis.yml"
66
- - CHANGELOG.rdoc
67
- - Gemfile
68
64
  - LICENSE.txt
69
- - README.rdoc
70
- - Rakefile
71
- - bin/console
72
- - bin/setup
73
65
  - lib/plist.rb
74
66
  - lib/plist/generator.rb
75
67
  - lib/plist/parser.rb
76
68
  - lib/plist/version.rb
77
- - plist.gemspec
78
69
  homepage: https://github.com/patsplat/plist
79
70
  licenses:
80
71
  - MIT
@@ -95,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
86
  version: '0'
96
87
  requirements: []
97
88
  rubyforge_project:
98
- rubygems_version: 2.7.3
89
+ rubygems_version: 2.7.6
99
90
  signing_key:
100
91
  specification_version: 4
101
92
  summary: All-purpose Property List manipulation library
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
@@ -1,16 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - ree
5
- - jruby-18mode
6
- - 1.8.7
7
- - jruby-19mode
8
- - 1.9.3
9
- - 2.0.0-p648 # macOS
10
- - 2.1.10
11
- - 2.2.7
12
- - 2.3.4
13
- - 2.4.1
14
- - ruby-head
15
- - jruby-head
16
- before_install: gem install bundler -v '~> 1.14' --conservative
@@ -1,133 +0,0 @@
1
- = plist - All-purpose Property List manipulation library
2
-
3
- === Unreleased
4
-
5
- https://github.com/patsplat/plist/compare/v3.4.0...HEAD
6
-
7
- * Your contribution here!
8
-
9
- === 3.4.0 (2017-12-08)
10
-
11
- https://github.com/patsplat/plist/compare/v3.3.0...v3.4.0
12
-
13
- * Support custom indent string (https://github.com/patsplat/plist/pull/44)
14
-
15
- === 3.3.0 (2017-04-28)
16
-
17
- https://github.com/patsplat/plist/compare/dece870...v3.3.0
18
-
19
- * Fix ASCII/UTF-8 error (https://github.com/patsplat/plist/pull/38).
20
- * Fix Fixnum, Bignum deprecations in Ruby 2.4
21
- * Fix unused variable `e` warning
22
-
23
- === 3.2.0 (2016-01-28)
24
-
25
- https://github.com/patsplat/plist/compare/ea0b4e7...dece870
26
-
27
- * Changed sort to sort_by in Plist::Emit.plist_node to allow mixed symbol and string hash keys
28
- * Updated deprecated File.exists? to File.exist?
29
- * Fixed defect in PData in which exception was thrown when <data/> element was read from plist
30
-
31
- === 3.1.0 (2010-02-23)
32
-
33
- 2010-02-23:
34
- * Ruby 1.9.x compatibility!
35
-
36
- 2010-02-16:
37
- * excise a bunch of unnecessary @@ variables
38
- * fix up some tests for cross-version compatibility
39
-
40
- 2010-02-14:
41
- * generalized cleanup:
42
- * fix old file headers
43
- * modernize rakefile
44
- * clean up rdoc
45
-
46
- 2010-01-08:
47
- * move from RubyForge Subversion to GitHub
48
-
49
- 2007-02-22 (r81):
50
- * 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.
51
-
52
- 2006-09-20 (r80):
53
- * tweak a comment in generator.rb to make it clear that we're not using Base64.b64encode because it's broken.
54
-
55
- === 3.0.0 (2006-09-20)
56
-
57
- 2006-09-20 (r77 - r79):
58
- * move IndentedString inside Plist::Emit and :nodoc: it
59
- * Tag 3.0.0! (from rev 78)
60
-
61
- 2006-09-19 (r73 - r75):
62
- * Really fix the rakefile this time (apparently I deleted some code that I needed...)
63
- * alter the fix_whitespace rake task to ignore the assets directory
64
- * cleanup whitespace
65
-
66
- 2006-09-18 (r70 - r72):
67
- * Update this file ;)
68
- * Fix Rakefile
69
- * gem install -t now works correctly
70
- * Remove super-sekr1t rdoc staging area from rdoc publishing task
71
-
72
- 2006-09-15 (r64 - r69):
73
- * Change behavior of empty collection elements to match What Apple Does
74
- * Fix some gem packaging infrastructure
75
-
76
- 2006-09-13 (r61 - r63):
77
- * Merge generator injection removal branch into trunk!
78
-
79
- 2006-09-13 (r52 - r60):
80
- * Fix indentation/newlines in generator (finally!)
81
- * Refix indentation to be more faithful to the way Apple emits their plists
82
- * Remove horrific regex and replace it with proper comment parsing
83
- * Empty plists return nil when parsed
84
- * Sort hash keys before emitting (now we can test multi-element hashes!)
85
- * Inject #<=> into Symbol so that sorting Symbol-keyed hashes won't freak out
86
-
87
- === 2.1.2 (2006-09-20)
88
-
89
- 2006-09-12 (r47 - r51):
90
- * More test rejiggering
91
- * New tests to expose some bugs
92
-
93
- 2006-09-10 (r33 - r46):
94
- * Update tests for new generator code
95
- * Rejigger some tests
96
- * 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
97
- * Marshal.dump unrecognized objects into <data> elements
98
- * Make the parser strip out comments and Marshal.load <data> elements if possible
99
- * Update some rdoc
100
-
101
- === 2.1.1 (2006-09-10)
102
-
103
- 2006-09-10 (r31 - r32):
104
- * Added encoding / decoding for entities (&amp; etc)
105
- * Changed parsing of <data> elements to return StringIO objects
106
- * Fixed bug with empty <key> tags
107
-
108
- 2006-08-24 (r25 - r30):
109
- * Invert ownership of methods in the generator, allowing us to remove the self.extend(self)
110
- * New branch to remove method inject from parser
111
-
112
- 2006-08-23 (r22 - r24):
113
- * Add rcov task to Rakefile
114
- * Add some tests
115
-
116
- 2006-08-20 (r9 - r21):
117
- * Add a bunch of rdoc and rdoc infrastructure
118
- * Add rake task to clean up errant whitespace
119
- * Spin off a branch to remove a bunch of method injection in the generator code
120
- * Rename some tests for clarity's sake
121
- * Replace NARF generation code with Ben's generation code
122
- * Update tests
123
- * This broke indentation (will be fixed later)
124
- * Add Plist::Emit.dump, so you can dump objects which don't include Plist::Emit, update tests to match
125
- * Fix a bug with the method that wraps output in the plist header/footer
126
-
127
- 2006-08-19 (r1 - r8):
128
- * The beginnings of merging the plist project into the NARF plist library (under the plist project's name)
129
- * fancier project infrastructure (more tests, Rakefile, the like)
130
- * Add/update copyright notices in the source files
131
- * Move a bunch of documentation out to README
132
- * Split library into chunks
133
- * Properly delete files when cleaning up from tests
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in plist.gemspec
4
- gemspec
@@ -1,184 +0,0 @@
1
- = All-purpose Property List manipulation library
2
-
3
- {<img src="https://badge.fury.io/rb/plist.svg" alt="Gem Version" />}[https://rubygems.org/gems/plist]
4
- {<img src="https://travis-ci.org/patsplat/plist.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/patsplat/plist]
5
-
6
- 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.
7
-
8
- == Usage
9
-
10
- === Security considerations
11
-
12
- Plist.parse_xml uses Marshal.load for <data/> attributes. If the <data/> attribute contains malicious data, an attacker can gain code execution.
13
- You should never use Plist.parse_xml with untrusted plists!
14
-
15
- === Parsing
16
-
17
- result = Plist.parse_xml('path/to/example.plist')
18
-
19
- result.class
20
- => Hash
21
-
22
- "#{result['FirstName']} #{result['LastName']}"
23
- => "John Public"
24
-
25
- result['ZipPostal']
26
- => "12345"
27
-
28
- ==== Example Property List
29
-
30
- <?xml version="1.0" encoding="UTF-8"?>
31
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
32
- <plist version="1.0">
33
- <dict>
34
- <key>FirstName</key>
35
- <string>John</string>
36
-
37
- <key>LastName</key>
38
- <string>Public</string>
39
-
40
- <key>StreetAddr1</key>
41
- <string>123 Anywhere St.</string>
42
-
43
- <key>StateProv</key>
44
- <string>CA</string>
45
-
46
- <key>City</key>
47
- <string>Some Town</string>
48
-
49
- <key>CountryName</key>
50
- <string>United States</string>
51
-
52
- <key>AreaCode</key>
53
- <string>555</string>
54
-
55
- <key>LocalPhoneNumber</key>
56
- <string>5551212</string>
57
-
58
- <key>ZipPostal</key>
59
- <string>12345</string>
60
- </dict>
61
- </plist>
62
-
63
- === Generation
64
-
65
- plist also provides the ability to generate plists from Ruby objects. The following Ruby classes are converted into native plist types:
66
- Array, Bignum, Date, DateTime, Fixnum, Float, Hash, Integer, String, Symbol, Time, true, false
67
-
68
- * +Array+ and +Hash+ are both recursive; their elements will be converted into plist nodes inside the <array> and <dict> containers (respectively).
69
- * +IO+ (and its descendants) and +StringIO+ objects are read from and their contents placed in a <data> element.
70
- * 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.
71
-
72
- ==== Creating a plist
73
-
74
- There are two ways to generate complete plists. Given an object:
75
-
76
- obj = [1, :two, {'c' => 0xd}]
77
-
78
- If you've mixed in <tt>Plist::Emit</tt> (which is already done for +Array+ and +Hash+), you can simply call +to_plist+:
79
-
80
- obj.to_plist
81
-
82
- This is equivalent to calling <tt>Plist::Emit.dump(obj)</tt>. Either one will yield:
83
-
84
- <?xml version="1.0" encoding="UTF-8"?>
85
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
86
- <plist version="1.0">
87
- <array>
88
- <integer>1</integer>
89
- <string>two</string>
90
- <dict>
91
- <key>c</key>
92
- <integer>13</integer>
93
- </dict>
94
- </array>
95
- </plist>
96
-
97
- You can also dump plist fragments by passing +false+ as the second parameter:
98
-
99
- Plist::Emit.dump('holy cow!', false)
100
- => "<string>holy cow!</string>"
101
-
102
- ==== Custom serialization
103
-
104
- 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.
105
-
106
- An example:
107
-
108
- class MyFancyString
109
- ...
110
-
111
- def to_plist_node
112
- return "<string>#{self.defancify}</string>"
113
- end
114
- end
115
-
116
- 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.
117
-
118
- If for whatever reason you can't add this method, your object will be serialized with <tt>Marshal.dump</tt> instead.
119
-
120
- ==== Custom indent
121
-
122
- You can customize the default indent foramt (default format is tab) or specify the indent format on each serialization. For example, if you want to reduce size of plist output, you can set the indent to <tt>nil</tt>.
123
-
124
- An example to change default indent format:
125
-
126
- Plist::Emit::DEFAULT_INDENT = nil
127
-
128
- An example to specify indent format on dump:
129
-
130
- Plist::Emit.dump({:foo => :bar}, false)
131
- => "<dict>\n\t<key>foo</key>\n\t<string>bar</string>\n</dict>\n"
132
-
133
- Plist::Emit.dump({:foo => :bar}, false, :indent => nil)
134
- => "<dict>\n<key>foo</key>\n<string>bar</string>\n</dict>\n"
135
-
136
-
137
- == Links
138
-
139
- [Rubygems] https://rubygems.org/gems/plist
140
- [GitHub] https://github.com/bleything/plist
141
- [RDoc] http://www.rubydoc.info/gems/plist
142
-
143
- == Credits
144
-
145
- plist was authored by Ben Bleything <mailto:ben@bleything.net> and Patrick May <mailto:patrick@hexane.org>. Patrick wrote most of the code; Ben contributed his plist generation library. The project is currently maintained by @mattbrictson[https://github.com/mattbrictson].
146
-
147
- Other folks who have helped along the way:
148
-
149
- [<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>
150
- [<b>Chuck Remes</b>] who pushed Patrick towards implementing <tt>#to_plist</tt>
151
- [<b>Mat Schaffer</b>] who supplied code and test cases for <tt><data></tt> elements
152
- [<b>Michael Granger</b>] for encouragement and help
153
- [<b>Carsten Bormann, Chris Hoffman, Dana Contreras, Hongli Lai, Johan Sørensen</b>] for contributing Ruby 1.9.x compatibility fixes
154
- And thank you to all of the other GitHub contributors[https://github.com/patsplat/plist/graphs/contributors] not mentioned here!
155
-
156
- == License and Copyright
157
-
158
- plist is released under the MIT License.
159
-
160
- 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.
161
-
162
- === MIT License
163
-
164
- Copyright (c) 2006-2010, Ben Bleything <ben@bleything.net> and Patrick May <patrick@hexane.org>
165
-
166
- Permission is hereby granted, free of charge, to any person obtaining
167
- a copy of this software and associated documentation files (the
168
- "Software"), to deal in the Software without restriction, including
169
- without limitation the rights to use, copy, modify, merge, publish,
170
- distribute, sublicense, and/or sell copies of the Software, and to
171
- permit persons to whom the Software is furnished to do so, subject to
172
- the following conditions:
173
-
174
- The above copyright notice and this permission notice shall be included
175
- in all copies or substantial portions of the Software.
176
-
177
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
178
- KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
179
- WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
180
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
181
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
182
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
183
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
184
-
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/test_*.rb"]
8
- end
9
-
10
- task :default => :test
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "plist"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,30 +0,0 @@
1
- # encoding: utf-8
2
-
3
- lib = File.expand_path("../lib", __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "plist/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "plist"
9
- spec.version = Plist::VERSION
10
- spec.authors = ["Ben Bleything", "Patrick May"]
11
-
12
- spec.summary = "All-purpose Property List manipulation library"
13
- spec.description = "Plist is a library to manipulate Property List files, "\
14
- "also known as plists. It can parse plist files into "\
15
- "native Ruby data structures as well as generating new "\
16
- "plist files from your Ruby objects."
17
- spec.homepage = "https://github.com/patsplat/plist"
18
- spec.license = "MIT"
19
-
20
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
- f.match(%r{^(test|spec|features)/})
22
- end
23
- spec.bindir = "exe"
24
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
- spec.require_paths = ["lib"]
26
-
27
- spec.add_development_dependency "bundler", "~> 1.14"
28
- spec.add_development_dependency "rake", "~> 10.5"
29
- spec.add_development_dependency "test-unit", "~> 1.2"
30
- end