idevice 1.1.5.4 → 1.1.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/idevice/c.rb CHANGED
@@ -27,7 +27,7 @@ module FFI
27
27
  class MemoryPointer < Pointer
28
28
  def self.from_bytes(data)
29
29
  if block_given?
30
- new(data.size) do |p|
30
+ new(data.bytesize) do |p|
31
31
  p.write_bytes(data)
32
32
  yield(p)
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module Idevice
2
- VERSION = "1.1.5.4"
2
+ VERSION = "1.1.5.5"
3
3
  end
data/spec/plist_spec.rb CHANGED
@@ -33,6 +33,32 @@ describe Plist do
33
33
  hash.should == {"Label" => "idevspecs", "Request" => "QueryType"}
34
34
  end
35
35
 
36
+ it "should parse a xml plist file to a data object" do
37
+ data = Plist.parse_xml(sample_file("plist_data.xml").read)
38
+ data.should be_a StringIO
39
+ data.string.should == "\u263a hey look it is a raw data blob \u263a"
40
+ end
41
+
42
+ it "should parse a binary plist file to a data object" do
43
+ data = Plist.parse_binary(sample_file("plist_data.bin").read)
44
+ data.should be_a StringIO
45
+ data.string.should == "\u263a hey look it is a raw data blob \u263a"
46
+ end
47
+
48
+ it "should parse a ASCII encoded binary plist string to a data object" do
49
+ rawdata = "bplist00O\x10&\xE2\x98\xBA hey look it is a raw data blob \xE2\x98\xBA\b\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x001"
50
+ data = Plist.parse_binary(rawdata)
51
+ data.should be_a StringIO
52
+ data.string.should == "\u263a hey look it is a raw data blob \u263a"
53
+ end
54
+
55
+ it "should parse a utf-8 encoded binary plist string to a data object" do
56
+ rawdata = "bplist00O\u0010&\u263a hey look it is a raw data blob \u263a\b\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00001"
57
+ data = Plist.parse_binary(rawdata)
58
+ data.should be_a StringIO
59
+ data.string.should == "\u263a hey look it is a raw data blob \u263a"
60
+ end
61
+
36
62
  it "should parse a xml plist to plist pointer" do
37
63
  ptr = Plist.xml_to_pointer(sample_file("plist.xml").read)
38
64
  ptr.should be_a FFI::Pointer
Binary file
@@ -0,0 +1,7 @@
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
+ <data>
5
+ 4pi6IGhleSBsb29rIGl0IGlzIGEgcmF3IGRhdGEgYmxvYiDimLo=
6
+ </data>
7
+ </plist>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idevice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5.4
4
+ version: 1.1.5.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-09 00:00:00.000000000 Z
12
+ date: 2013-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -171,6 +171,8 @@ files:
171
171
  - spec/restore_devicespec.rb
172
172
  - spec/samples/plist.bin
173
173
  - spec/samples/plist.xml
174
+ - spec/samples/plist_data.bin
175
+ - spec/samples/plist_data.xml
174
176
  - spec/sbservices_devicespec.rb
175
177
  - spec/screenshotr_devicespec.rb
176
178
  - spec/spec_helper.rb
@@ -190,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
192
  version: '0'
191
193
  segments:
192
194
  - 0
193
- hash: -1124401989614108024
195
+ hash: 3300865769966044297
194
196
  required_rubygems_version: !ruby/object:Gem::Requirement
195
197
  none: false
196
198
  requirements:
@@ -199,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
201
  version: '0'
200
202
  segments:
201
203
  - 0
202
- hash: -1124401989614108024
204
+ hash: 3300865769966044297
203
205
  requirements: []
204
206
  rubyforge_project:
205
207
  rubygems_version: 1.8.25
@@ -227,6 +229,8 @@ test_files:
227
229
  - spec/restore_devicespec.rb
228
230
  - spec/samples/plist.bin
229
231
  - spec/samples/plist.xml
232
+ - spec/samples/plist_data.bin
233
+ - spec/samples/plist_data.xml
230
234
  - spec/sbservices_devicespec.rb
231
235
  - spec/screenshotr_devicespec.rb
232
236
  - spec/spec_helper.rb