CFPropertyList 2.1 → 2.1.1

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.
@@ -439,17 +439,16 @@ module CFPropertyList
439
439
 
440
440
  @unique_table[val] ||= begin
441
441
  if !Binary.ascii_string?(val)
442
- utf8_strlen = Binary.charset_strlen(val, "UTF-8")
443
442
  val = Binary.charset_convert(val,"UTF-8","UTF-16BE")
444
443
  bdata = Binary.type_bytes(0b0110, Binary.charset_strlen(val,"UTF-16BE"))
445
444
 
446
445
  val.force_encoding("ASCII-8BIT") if val.respond_to?("encode")
447
446
  @object_table[@written_object_count] = bdata << val
448
447
  else
449
- utf8_strlen = val.bytesize
450
448
  bdata = Binary.type_bytes(0b0101,val.bytesize)
451
449
  @object_table[@written_object_count] = bdata << val
452
450
  end
451
+
453
452
  @written_object_count += 1
454
453
  @written_object_count - 1
455
454
  end
@@ -10,6 +10,8 @@ module CFPropertyList
10
10
  # * :file - The filename of the file to load
11
11
  # * :data - The data to parse
12
12
  def load(opts)
13
+
14
+ doc = nil
13
15
  if(opts.has_key?(:file)) then
14
16
  File.open(opts[:file], "rb") { |fd| doc = Nokogiri::XML::Document.parse(fd, nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS|Nokogiri::XML::ParseOptions::NOENT) }
15
17
  else
@@ -10,6 +10,8 @@ module CFPropertyList
10
10
  # * :file - The filename of the file to load
11
11
  # * :data - The data to parse
12
12
  def load(opts)
13
+
14
+ doc = nil
13
15
  if(opts.has_key?(:file)) then
14
16
  File.open(opts[:file], "rb") { |fd| doc = REXML::Document.new(fd) }
15
17
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CFPropertyList
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-02 00:00:00.000000000 Z
12
+ date: 2012-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &7342600 !ruby/object:Gem::Requirement
16
+ requirement: &6863720 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.7.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *7342600
24
+ version_requirements: *6863720
25
25
  description: This is a module to read, write and manipulate both binary and XML property
26
26
  lists as defined by apple.
27
27
  email: cjk@wwwtech.de