plist 3.6.0 → 3.7.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 +4 -4
- data/lib/plist/parser.rb +18 -11
- data/lib/plist/version.rb +1 -1
- metadata +4 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34fa4fc386b9fb97f4e27a345e5a15fcae275edba2e2c92285ef04ffb25ee2b8
|
4
|
+
data.tar.gz: a0a416e828b8232c07fe1b817929b55697c2234856d2a2801123e3df9cc6bb17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0742f71c11f859b4b104b0e3f2bf8896b736397fbfe54eef20b72439a582448af160649c205507b66aa87c506d216745f794b73fe8aa77c3e7f576289b68c88
|
7
|
+
data.tar.gz: c413bc34bdfb8edd54377bb7fb9210ccfa81992b98acb131499582785aec7b7764c1463eacfdb6768bfe3d70d1bde213045b08182a6ed60b8f44b2ee18ef9974
|
data/lib/plist/parser.rb
CHANGED
@@ -26,8 +26,13 @@ module Plist
|
|
26
26
|
# can't be parsed into a Time object, please create an issue
|
27
27
|
# attaching your plist file at https://github.com/patsplat/plist/issues
|
28
28
|
# so folks can implement the proper support.
|
29
|
-
|
30
|
-
|
29
|
+
#
|
30
|
+
# By default, <data> will be assumed to be a marshaled Ruby object and
|
31
|
+
# interpreted with <tt>Marshal.load</tt>. Pass <tt>marshal: false</tt>
|
32
|
+
# to disable this behavior and return the raw binary data as an IO
|
33
|
+
# object instead.
|
34
|
+
def self.parse_xml(filename_or_xml, options={})
|
35
|
+
listener = Listener.new(options)
|
31
36
|
# parser = REXML::Parsers::StreamParser.new(File.new(filename), listener)
|
32
37
|
parser = StreamParser.new(filename_or_xml, listener)
|
33
38
|
parser.parse
|
@@ -39,13 +44,14 @@ module Plist
|
|
39
44
|
|
40
45
|
attr_accessor :result, :open
|
41
46
|
|
42
|
-
def initialize
|
47
|
+
def initialize(options={})
|
43
48
|
@result = nil
|
44
49
|
@open = []
|
50
|
+
@options = { :marshal => true }.merge(options).freeze
|
45
51
|
end
|
46
52
|
|
47
53
|
def tag_start(name, attributes)
|
48
|
-
@open.push PTag.mappings[name].new
|
54
|
+
@open.push PTag.mappings[name].new(@options)
|
49
55
|
end
|
50
56
|
|
51
57
|
def text(contents)
|
@@ -154,9 +160,10 @@ module Plist
|
|
154
160
|
mappings[key] = sub_class
|
155
161
|
end
|
156
162
|
|
157
|
-
attr_accessor :text, :children
|
158
|
-
def initialize
|
163
|
+
attr_accessor :text, :children, :options
|
164
|
+
def initialize(options)
|
159
165
|
@children = []
|
166
|
+
@options = options
|
160
167
|
end
|
161
168
|
|
162
169
|
def to_ruby
|
@@ -244,13 +251,13 @@ module Plist
|
|
244
251
|
def to_ruby
|
245
252
|
data = Base64.decode64(text.gsub(/\s+/, '')) unless text.nil?
|
246
253
|
begin
|
247
|
-
return Marshal.load(data)
|
254
|
+
return Marshal.load(data) if options[:marshal]
|
248
255
|
rescue Exception
|
249
|
-
io = StringIO.new
|
250
|
-
io.write data
|
251
|
-
io.rewind
|
252
|
-
return io
|
253
256
|
end
|
257
|
+
io = StringIO.new
|
258
|
+
io.write data
|
259
|
+
io.rewind
|
260
|
+
io
|
254
261
|
end
|
255
262
|
end
|
256
263
|
end
|
data/lib/plist/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Bleything
|
@@ -9,50 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
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'
|
12
|
+
date: 2023-02-21 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
56
14
|
description: Plist is a library to manipulate Property List files, also known as plists.
|
57
15
|
It can parse plist files into native Ruby data structures as well as generating
|
58
16
|
new plist files from your Ruby objects.
|
@@ -85,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
43
|
- !ruby/object:Gem::Version
|
86
44
|
version: '0'
|
87
45
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
46
|
+
rubygems_version: 3.4.7
|
89
47
|
signing_key:
|
90
48
|
specification_version: 4
|
91
49
|
summary: All-purpose Property List manipulation library
|