dor-fetcher 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/dor-fetcher.rb +10 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2MyNDEzMjAxNjFjZWZmYzNlNmExN2Y4NzI3MTM0Njc3ODFlODJlOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2FhYzU1Zjk0ZTdlYjNiZTMyZDVhYjJiMGRhZmY0YzIyMTFkODBlMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWE3YjdjMmY2YzdiYTc0YmNiYzhkNTNlMjdiOGQ1ODdiNWE3MDgwYjE1Nzk2
|
10
|
+
ZmM0OWEwNjk0Yzk0MDI4ODk5YmY0ZjNjMTcxNjljNDExZjJjYTQ0ODc4NGMz
|
11
|
+
ZjE3MjVhNTdiZTdkOGQ3MThhMjRkMzBiMjQxM2Y3NzYwOTk3NWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTk0ZjZmNTIzN2EzYmIyZmJmMjJhMTgxMWI0OWNhOTE4MDQ4ZjYwZmIwYmZl
|
14
|
+
Zjk3ZDNkMzQ5MDBmMDYzNzk0NjBlYTM3N2NiNjMyNDQyOTQyNDcyYTQ3Mzdk
|
15
|
+
ZjViY2E2YTdiZWM5YzVhNmFmZDJlYzkyODBlOWYxZWM5ZjZlZDI=
|
data/lib/dor-fetcher.rb
CHANGED
@@ -19,21 +19,24 @@ module DorFetcher
|
|
19
19
|
def initialize options = {}
|
20
20
|
#TODO: Check for a well formed URL and a 200 from the destination before just accepting this
|
21
21
|
@service_url = options[:service_url] || @@default_service_url
|
22
|
-
@site = RestClient::Resource.new(@service_url)
|
22
|
+
@site = RestClient::Resource.new(@service_url, :timeout => nil, :open_timeout => nil)
|
23
23
|
|
24
24
|
if not options[:skip_heartbeat]
|
25
|
-
raise "DorFetcher::Client Error! No response from #{@service_url}" if not self.is_alive
|
25
|
+
raise "DorFetcher::Client Error! No response from #{@service_url}" if not self.is_alive?
|
26
26
|
end
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
end
|
28
|
+
|
29
|
+
# Return service info (rails env, version deployed, last restart and last deploy)
|
30
|
+
#@return [hash] Hash containing service info
|
31
|
+
def service_info
|
32
|
+
resp = @site['about/version.json'].get
|
33
|
+
return JSON[resp]
|
30
34
|
end
|
31
35
|
|
32
36
|
#Check to see if the dor-fetcher-service is responding to requests, this is a basic heart beat checker
|
33
37
|
#@return [Boolean] True for a service that responds, False for a service that does not.
|
34
|
-
def is_alive
|
38
|
+
def is_alive?
|
35
39
|
resp = @site.get
|
36
|
-
#Since dor-fetcher-service uses the is_alive gem, the main page should simply have okay on it
|
37
40
|
return 200.eql?(resp.code) && "ok".eql?(resp)
|
38
41
|
end
|
39
42
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-fetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carrick Rogers
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-11-
|
13
|
+
date: 2014-11-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|