image-dumper 0.6.1 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dumper/dumper.rb +11 -4
- data/lib/dumper/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: 3c4a215cb421e1431d04d5f6c326a9f5b83f6877
|
4
|
+
data.tar.gz: 348906e916a00fce766129e6f045bf146dc3f2cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cb20d9ea19acfd8cf88a6b35777f1d58acd0175a8937ecc0b59de04889f6ba7a05a8020611905ce0832390e85724e5c4dcc5ba568d42c2f6c874eb392505d3a
|
7
|
+
data.tar.gz: d136a79f06cda4983f79488a35c060dfd55ffeb529942bdd4e090a9ef1e5734a3159640e9ef3be6f3d7d4638e9598153a0cf03e6aff818ba7bf2857a8d758aa4
|
data/lib/dumper/dumper.rb
CHANGED
@@ -75,7 +75,8 @@ module Dumper
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def get(path, url, options = {})
|
78
|
-
url
|
78
|
+
url = url.to_s
|
79
|
+
errors = 0
|
79
80
|
|
80
81
|
begin
|
81
82
|
if url.start_with? 'data:image/'
|
@@ -111,9 +112,15 @@ module Dumper
|
|
111
112
|
end
|
112
113
|
end
|
113
114
|
rescue Exception => e
|
114
|
-
|
115
|
-
|
116
|
-
|
115
|
+
if errors <= 3
|
116
|
+
errors += 1
|
117
|
+
sleep 3
|
118
|
+
retry
|
119
|
+
else
|
120
|
+
p e
|
121
|
+
puts "Error downloading #{url}."
|
122
|
+
return false
|
123
|
+
end
|
117
124
|
end
|
118
125
|
|
119
126
|
true
|
data/lib/dumper/version.rb
CHANGED