gscholar 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/gscholar.gemspec +1 -1
- data/lib/gscholar.rb +0 -6
- data/lib/gscholar/utils.rb +0 -4
- data/lib/gscholar/utils/fetcher.rb +11 -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: a928bc754b26578753527fde89ad8c7b502e11ce
|
4
|
+
data.tar.gz: e43c195709f89aefdf22a0c406cd9f9cdcea6dc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e8b65a227ed1d91e9b7ec3ac48b4dbb9a2f36b6178e211510e1bcb7ed798091462ae4374c5a9f96ad0786e230ed3b6f3fc11e4842008f66f27ca6cf73bcc9c4
|
7
|
+
data.tar.gz: 4ae1dc7288ba7bbe244b63159bf3317c749fce27bb25961f4baf07db1a02326d5704f1dd5b3cf44c1d85eff09dd4c15ea5f4b0c0f37fc323e1828c644a4c10f6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/gscholar.gemspec
CHANGED
data/lib/gscholar.rb
CHANGED
data/lib/gscholar/utils.rb
CHANGED
@@ -18,7 +18,17 @@ module GScholar
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def fetch(url)
|
21
|
-
|
21
|
+
begin
|
22
|
+
@cache[url] ||= @agent.get(url)
|
23
|
+
rescue Mechanize::ResponseCodeError => e
|
24
|
+
case e.response_code
|
25
|
+
when 403
|
26
|
+
@agent.reset
|
27
|
+
retry
|
28
|
+
else
|
29
|
+
raise
|
30
|
+
end
|
31
|
+
end
|
22
32
|
end
|
23
33
|
end
|
24
34
|
|