okcomputer 1.18.3 → 1.18.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d75f6ac70b72178da8aba2204e535d0e99453cafa7e2bf969cb436d0c96c540
4
- data.tar.gz: 5492a49d928732c3353f95836f3dbf11bf6b105fefd6a1223590ca3aa8c456fa
3
+ metadata.gz: 6b0d00a1c27b81d74873969d466755cbb53f39891dd1d83f18e9912f155daaec
4
+ data.tar.gz: e2f26b7017a2948403a728e9714b9e732ab1f07a7393b40ed70382d1d034c15f
5
5
  SHA512:
6
- metadata.gz: a6ed7187a87456d8fbe37ac6feb097a4d49cea0b6eb7b5111b4b48f47a586f234d7b8630887a590ac64b4fbb9ed81dadeb2c05b75d7ec2615cf4c71d918b4c2e
7
- data.tar.gz: 9c8b8b2af22dd1dc38a10d2a2c2a8ef06b98814c4153d1deb57f76e107bc7496a377f57e1761304a671e5d374a5e39151b2c7e8e898bca588d130fccb6e099b8
6
+ metadata.gz: f3f509cdc9465236d912549083636aa2dc58bd16bd80fdb167533c3cbd7f17fd3e9405b59db84e480cb3122a00e948ac6b8d61d43c5ca695aeb61ab732cc4cf0
7
+ data.tar.gz: 9d0df64eb500c33bd45c2192006798bc909941fe43bedfb639966006d0cf763ab558e23b1086a131b0fe3945ced41922764f46b976da3ea7c3d5eea264779ed5
data/README.markdown CHANGED
@@ -1,6 +1,5 @@
1
1
  [![Code Climate](https://codeclimate.com/github/sportngin/okcomputer.svg)](https://codeclimate.com/github/sportngin/okcomputer)
2
- [![Build Status](https://travis-ci.org/sportngin/okcomputer.svg)](https://travis-ci.org/sportngin/okcomputer)
3
- [![Coverage Status](https://coveralls.io/repos/sportngin/okcomputer/badge.svg?branch=master)](https://coveralls.io/r/sportngin/okcomputer)
2
+ [![Build Status](https://github.com/sportngin/okcomputer/workflows/CI/badge.svg)](https://github.com/sportngin/okcomputer/actions?query=workflow%3ACI)
4
3
 
5
4
  # OK Computer
6
5
 
@@ -17,6 +16,7 @@ OK Computer][blog].
17
16
 
18
17
  OkComputer currently supports the following Rails versions:
19
18
 
19
+ * 7.0
20
20
  * 6.1
21
21
  * 6.0
22
22
  * 5.2
@@ -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)
@@ -27,7 +27,7 @@ module OkComputer
27
27
  end
28
28
 
29
29
  def cache_key
30
- "ock-generic-cache-check-#{Socket.gethostname}"
30
+ "okc-generic-cache-check-#{Socket.gethostname}"
31
31
  end
32
32
 
33
33
  def humanize_cache_store_name
@@ -1,3 +1,3 @@
1
1
  module OkComputer
2
- VERSION = '1.18.3'
2
+ VERSION = '1.18.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okcomputer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.3
4
+ version: 1.18.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-02-04 00:00:00.000000000 Z
13
+ date: 2023-10-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sqlite3
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.1.4
143
+ rubygems_version: 3.2.33
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: A simple, extensible health-check monitor