okcomputer 1.17.4 → 1.18.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3e1e1a02dc10cd50d4c49bce44af5b1671fbfb52362862be5b0b10541890eb8
4
- data.tar.gz: f0f153059d6da383f1abdc33bfe9cfdfadd38db34d2318f8aff2438280a4e677
3
+ metadata.gz: 964bccbd2510184da0f52827f5558f8745076a8c8725745a9c7659b04779c6db
4
+ data.tar.gz: 4525ecd9968072a9f2be2da58dbbe63d238e55800168e3e3b3b26006335f79a7
5
5
  SHA512:
6
- metadata.gz: 5af9d11e510cabbd401e9c0623d598bf0b9269d891aeb1d919584a2391de6245c3370d841402e58f40a8ae520cad9e1fc748c8b2952af163a56d6b451ce718f8
7
- data.tar.gz: 2fa2f6ddd543119e9747239bace7628233ad114bde1746c46d30b31a90faf72b4160a5ad3feae5b7ecb11d5a46fbec03d6431bdb69d15f35242acd34bb4c7faf
6
+ metadata.gz: 76d6c635b55919898267bcbdb48e4a2da3342c52316038427d6771d2f277890ddd88f9389a9016a41ee2c2c0e7cb28f7a1a1b2cf5a3535ba9122724fac8eb961
7
+ data.tar.gz: 4be31489a2a1bf21d5e91aff93f675cbbe75e30c2cfbeea3687faed27ab204965e1e75765fb7c02e0b57eb6620b8ae07824e596eff3520c607009608a9405443
data/README.markdown CHANGED
@@ -17,6 +17,8 @@ OK Computer][blog].
17
17
 
18
18
  OkComputer currently supports the following Rails versions:
19
19
 
20
+ * 6.1
21
+ * 6.0
20
22
  * 5.2
21
23
  * 5.1
22
24
  * 4.2
@@ -42,7 +42,7 @@ module OkComputer
42
42
  end
43
43
 
44
44
  def status_code(check)
45
- check.success? ? :ok : :error
45
+ check.success? ? :ok : :internal_server_error
46
46
  end
47
47
 
48
48
  def authenticate
@@ -5,6 +5,21 @@ module OkComputer
5
5
  # * Otherwise, checks for Capistrano's REVISION file in the app root.
6
6
  # * Failing these, the check fails
7
7
  class AppVersionCheck < Check
8
+ attr_accessor :file
9
+ attr_accessor :env
10
+ attr_accessor :transform
11
+
12
+ # Public: Initialize a check for a backed-up Sidekiq queue
13
+ #
14
+ # file - The path of the version file to check
15
+ # env - The key in ENV to check for a revision SHA
16
+ # transform - The block to optionally transform the version string
17
+ def initialize(file: "REVISION", env: "SHA", &transform)
18
+ self.file = file
19
+ self.env = env
20
+ self.transform = transform || proc { |v| v }
21
+ end
22
+
8
23
  # Public: Return the application version
9
24
  def check
10
25
  mark_message "Version: #{version}"
@@ -17,21 +32,20 @@ module OkComputer
17
32
  #
18
33
  # Returns a String
19
34
  def version
20
- version_from_env || version_from_file || raise(UnknownRevision)
35
+ transform.call(version_from_env || version_from_file || raise(UnknownRevision))
21
36
  end
22
37
 
23
38
  private
24
39
 
25
40
  # Private: Version stored in environment variable
26
41
  def version_from_env
27
- ENV["SHA"]
42
+ ENV[env]
28
43
  end
29
44
 
30
45
  # Private: Version stored in Capistrano revision file
31
46
  def version_from_file
32
- if File.exist?(Rails.root.join("REVISION"))
33
- File.read(Rails.root.join("REVISION")).chomp
34
- end
47
+ path = Rails.root.join(file)
48
+ File.read(path).chomp if File.exist?(path)
35
49
  end
36
50
 
37
51
  UnknownRevision = Class.new(StandardError)
@@ -6,7 +6,7 @@ module OkComputer
6
6
  connected = Neo4j::Session.current.connection.head.success?
7
7
  url = Neo4j::Session.current.connection.url_prefix.to_s
8
8
  mark_message "Connected to neo4j on #{url}" if connected
9
- rescue Faraday::Error::ConnectionFailed => e
9
+ rescue Faraday::ConnectionFailed => e
10
10
  mark_failure
11
11
  mark_message "Error: #{e.message}"
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module OkComputer
2
- VERSION = '1.17.4'
2
+ VERSION = '1.18.4'
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okcomputer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.4
4
+ version: 1.18.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
8
8
  - Andy Fleener
9
9
  - Chris Arcand
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-03-26 00:00:00.000000000 Z
13
+ date: 2021-02-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sqlite3
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '3.0'
35
+ version: '4.0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '3.0'
42
+ version: '4.0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: coveralls
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -125,7 +125,7 @@ homepage: https://github.com/sportngin/okcomputer
125
125
  licenses:
126
126
  - MIT
127
127
  metadata: {}
128
- post_install_message:
128
+ post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
131
131
  - lib
@@ -140,9 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubyforge_project:
144
- rubygems_version: 2.7.6
145
- signing_key:
143
+ rubygems_version: 3.1.4
144
+ signing_key:
146
145
  specification_version: 4
147
146
  summary: A simple, extensible health-check monitor
148
147
  test_files: []