organization_audit 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/organization_audit/repo.rb +13 -2
- data/lib/organization_audit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0184c6c28eeac80b8b0ae076a7fae8d27371084
|
4
|
+
data.tar.gz: c961aad449d2a8730a70743956b27291c3a63729
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13d818408c96d325ad7569eebba2b97dc5a06b7f5efe5e705258fe84e286427aa72371ae35f047fd75ea40ada5f077a782f0681a147b0aed10fc7c2ac54e7e1d
|
7
|
+
data.tar.gz: 7a3ed8d3db5d7fa1bc374257a0594be39e54704e5eb9f1c690afa61d47764532fe770bed7d2f40fd291f9442ce98a717e75b0965eb5d0e9b21b2505db85ad145
|
@@ -145,7 +145,7 @@ module OrganizationAudit
|
|
145
145
|
|
146
146
|
def call_api(path)
|
147
147
|
content = self.class.decorate_errors do
|
148
|
-
|
148
|
+
download(File.join(api_url, path), self.class.headers(@token))
|
149
149
|
end
|
150
150
|
JSON.load(content)
|
151
151
|
end
|
@@ -159,7 +159,18 @@ module OrganizationAudit
|
|
159
159
|
|
160
160
|
# unlimited
|
161
161
|
def download_content_via_raw(file)
|
162
|
-
|
162
|
+
download(File.join(raw_url, branch, file))
|
163
|
+
end
|
164
|
+
|
165
|
+
def download(url, headers={})
|
166
|
+
open(url, headers).read
|
167
|
+
rescue OpenURI::HTTPError => e
|
168
|
+
if e.message.start_with?("503 Connection timed out")
|
169
|
+
retries ||= 0
|
170
|
+
retries += 1
|
171
|
+
retry if retries < 3
|
172
|
+
end
|
173
|
+
raise e
|
163
174
|
end
|
164
175
|
|
165
176
|
def self.headers(token)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: organization_audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|