findmyiphone 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{findmyiphone}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Matt Biddulph"]
@@ -25,7 +25,11 @@ class FindMyIphone
25
25
  }
26
26
 
27
27
  page = @agent.post(devicesurl)
28
- @thedevices = page.content.scan(/tDeviceMgmt.deviceIdMap\['[0-9+]'\] = '([^']+)'/).flatten
28
+ if @thedevices = page.content.match(/tDeviceMgmt.deviceIdMap\['[0-9+]'\] = '([^']+)'/)
29
+ @thedevices = @thedevices.captures
30
+ else
31
+ raise "No registered devices could be found"
32
+ end
29
33
  end
30
34
  return @thedevices
31
35
  end
@@ -52,7 +56,7 @@ class FindMyIphone
52
56
 
53
57
  def send(url,data)
54
58
  uri = URI.parse(url)
55
- json = JSON.generate(data)
59
+ json = data.to_json
56
60
 
57
61
  http = Net::HTTP.new(uri.host, uri.port)
58
62
  http.use_ssl = true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: findmyiphone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Biddulph