dor-fetcher 1.1.2 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/dor-fetcher.rb +10 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDIzMmIyMTY5NzNjZGQzYWExMzhmYWFhNDY0ZmVkZjE3ZGFkNGIwMw==
4
+ Y2MyNDEzMjAxNjFjZWZmYzNlNmExN2Y4NzI3MTM0Njc3ODFlODJlOA==
5
5
  data.tar.gz: !binary |-
6
- YzU5NDYyYTA2ZTVjOTMwNDBhYjBiNjg5YzNiYzM4MzIyZDdmOGUwNA==
6
+ Y2FhYzU1Zjk0ZTdlYjNiZTMyZDVhYjJiMGRhZmY0YzIyMTFkODBlMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDYzZGFmOWYzZGY5Mjk2ZTM5ZjU5ZDNhNGI1YTBjNGEzZWEzZDdjOTBiODgx
10
- MzBkOTdiYmE2N2ZlNDQxOWMyODg0MTI5OWUzZjc5MjEzYTE0NjliNGZhYzg1
11
- ZGM3MGRiY2Q5Mzg3YmUyOTIzNDEyNDRlM2E1ZDkxZTViZTc1M2M=
9
+ YWE3YjdjMmY2YzdiYTc0YmNiYzhkNTNlMjdiOGQ1ODdiNWE3MDgwYjE1Nzk2
10
+ ZmM0OWEwNjk0Yzk0MDI4ODk5YmY0ZjNjMTcxNjljNDExZjJjYTQ0ODc4NGMz
11
+ ZjE3MjVhNTdiZTdkOGQ3MThhMjRkMzBiMjQxM2Y3NzYwOTk3NWM=
12
12
  data.tar.gz: !binary |-
13
- MmY0NzBlOTcyMWZjM2Y4NzJiZGExNmI0NWFkOTkzM2Y2OGI2OTZjMmYzOTE0
14
- MWJmYWY2M2VmNDNmNjI4MGE1Njk2NmYxNzdiNGY2NWViNWZlM2NmZDEwZjc5
15
- YjZmNjZlNDk4MWQwOGRlYzk2NjhhYmEzN2MzMjUzMDUwOTVmMjE=
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.2
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-11 00:00:00.000000000 Z
13
+ date: 2014-11-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec