okcomputer 1.17.1 → 1.17.2
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4ffa607e9d632dbb194f9c215afdb9f10508b9b8fe6fe71617ab3ad5ed87da6d
|
4
|
+
data.tar.gz: b2c025ac565413e32a9dee2c7cea6df9b1cc4dc572e819fdfd48bad57a5c6323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d13a1afb7a42e0e875bc36ea2ad7f0f63a7a01676317f2b2c193d432c94903d7053f0c466cdf5f09290a521339401bf6f162b07362088a015e6222d55f9a41a
|
7
|
+
data.tar.gz: bebc83ba4befb465d1e614f8bb0e915e5d1496a4a55743205a903d41cec3abe8b175abb832b24ad4a1557d2d7d0aaaba1feb8ffbc3f256fd0ee7fe29ed798a12
|
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[](https://codeclimate.com/github/sportngin/okcomputer)
|
2
|
+
[](https://travis-ci.org/sportngin/okcomputer)
|
3
|
+
[](https://coveralls.io/r/sportngin/okcomputer)
|
4
4
|
|
5
5
|
# OK Computer
|
6
6
|
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module OkComputer
|
2
2
|
class ActiveRecordMigrationsCheck < Check
|
3
|
-
|
4
3
|
# Public: Check if migrations are pending or not
|
5
4
|
def check
|
6
|
-
return unsupported unless
|
5
|
+
return unsupported unless supported?
|
7
6
|
|
8
|
-
if
|
7
|
+
if needs_migration?
|
9
8
|
mark_failure
|
10
9
|
mark_message "Pending migrations"
|
11
10
|
else
|
@@ -13,6 +12,20 @@ module OkComputer
|
|
13
12
|
end
|
14
13
|
end
|
15
14
|
|
15
|
+
def needs_migration?
|
16
|
+
if ActiveRecord::Migrator.respond_to?(:needs_migration?) # Rails <= 5.1
|
17
|
+
ActiveRecord::Migrator.needs_migration?
|
18
|
+
else # Rails >= 5.2
|
19
|
+
ActiveRecord::Base.connection.migration_context.needs_migration?
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def supported?
|
24
|
+
ActiveRecord::Migrator.respond_to?(:needs_migration?) ||
|
25
|
+
(ActiveRecord::Base.connection.respond_to?(:migration_context) &&
|
26
|
+
ActiveRecord::Base.connection.migration_context.respond_to?(:needs_migration?))
|
27
|
+
end
|
28
|
+
|
16
29
|
private
|
17
30
|
|
18
31
|
# Private: Fail the check if ActiveRecord cannot check migration status
|
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.17.
|
4
|
+
version: 1.17.2
|
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: 2018-04-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sqlite3
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.7.6
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: A simple, extensible health-check monitor
|