okcomputer 1.18.3 → 1.18.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b0d00a1c27b81d74873969d466755cbb53f39891dd1d83f18e9912f155daaec
|
4
|
+
data.tar.gz: e2f26b7017a2948403a728e9714b9e732ab1f07a7393b40ed70382d1d034c15f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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://
|
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[
|
42
|
+
ENV[env]
|
28
43
|
end
|
29
44
|
|
30
45
|
# Private: Version stored in Capistrano revision file
|
31
46
|
def version_from_file
|
32
|
-
|
33
|
-
|
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)
|
data/lib/ok_computer/version.rb
CHANGED
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.
|
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:
|
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.
|
143
|
+
rubygems_version: 3.2.33
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: A simple, extensible health-check monitor
|