pear_warranty 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pear_warranty.rb +3 -3
- data/lib/pear_warranty/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d02cfd647347b554ae3f5cadbaa2112026de3565
|
4
|
+
data.tar.gz: 0301c37701a36369fcb8f6fc85626f98c9297995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74f6407b991dae65ebeceb6523cb78598927189163516242f88f857c8b920bc04d51320afb35475700c44cb0757232132dbaeb9a0915e9259a7e8c5c50c6d27d
|
7
|
+
data.tar.gz: a50b83b0c678485c22548f5fae3864518cdfbdc6e7a706a93f28169c59743516b5a49033ca64b35b337451d070152714c5ccf6a9376bc72eeea1233a1a04c0a6
|
data/lib/pear_warranty.rb
CHANGED
@@ -9,7 +9,7 @@ module PearWarranty
|
|
9
9
|
|
10
10
|
def self.check(serial, proxy_index = nil)
|
11
11
|
agent = Mechanize.new
|
12
|
-
proxy_index ||= rand(
|
12
|
+
proxy_index ||= rand(PROXIES.size)
|
13
13
|
page = nil
|
14
14
|
error = true
|
15
15
|
apple_url = "https://selfsolve.apple.com/wcResults.do?sn=#{serial}&Continue=Continue&num=0"
|
@@ -19,7 +19,7 @@ module PearWarranty
|
|
19
19
|
begin
|
20
20
|
page = agent.submit(form)
|
21
21
|
rescue Net::HTTP::Persistent::Error
|
22
|
-
proxy_index = rand(
|
22
|
+
proxy_index = rand(PROXIES.size)
|
23
23
|
next
|
24
24
|
end
|
25
25
|
page = page.body
|
@@ -27,7 +27,7 @@ module PearWarranty
|
|
27
27
|
error = false
|
28
28
|
break
|
29
29
|
end
|
30
|
-
proxy_index = rand(
|
30
|
+
proxy_index = rand(PROXIES.size)
|
31
31
|
end
|
32
32
|
if error
|
33
33
|
{error: 'Problem with proxy'}
|