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
- SHA1:
3
- metadata.gz: 6126a535a942b65367805a9f6c1ee5afe56e4e4b
4
- data.tar.gz: 60d5bc36241ac4a76c934b94b6d9466f9cbfff2a
2
+ SHA256:
3
+ metadata.gz: 4ffa607e9d632dbb194f9c215afdb9f10508b9b8fe6fe71617ab3ad5ed87da6d
4
+ data.tar.gz: b2c025ac565413e32a9dee2c7cea6df9b1cc4dc572e819fdfd48bad57a5c6323
5
5
  SHA512:
6
- metadata.gz: 6e2dcc008f46b772982e3109e43248b25f6bb61276737eafb8244cf40486083e9874822bcc338c8b6c574a004303c686ef0698dcbc8c594eb3c14902be28b940
7
- data.tar.gz: 84040eaca97adf8a1e8d646ea8ada739f789e17008e12ab5eb7a301015729be3c06f9d2a2c4c9b66cf21a7b8b078feca01a3f7f9b9dc230b00937dc17bed10f4
6
+ metadata.gz: 0d13a1afb7a42e0e875bc36ea2ad7f0f63a7a01676317f2b2c193d432c94903d7053f0c466cdf5f09290a521339401bf6f162b07362088a015e6222d55f9a41a
7
+ data.tar.gz: bebc83ba4befb465d1e614f8bb0e915e5d1496a4a55743205a903d41cec3abe8b175abb832b24ad4a1557d2d7d0aaaba1feb8ffbc3f256fd0ee7fe29ed798a12
@@ -1,6 +1,6 @@
1
- [![Code Climate](https://codeclimate.com/github/sportngin/okcomputer.png)](https://codeclimate.com/github/sportngin/okcomputer)
2
- [![Build Status](https://travis-ci.org/sportngin/okcomputer.png)](https://travis-ci.org/sportngin/okcomputer)
3
- [![Coverage Status](https://coveralls.io/repos/sportngin/okcomputer/badge.png?branch=master)](https://coveralls.io/r/sportngin/okcomputer)
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)
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 ActiveRecord::Migrator.respond_to?(:needs_migration?)
5
+ return unsupported unless supported?
7
6
 
8
- if ActiveRecord::Migrator.needs_migration?
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
@@ -1,3 +1,3 @@
1
1
  module OkComputer
2
- VERSION = '1.17.1'
2
+ VERSION = '1.17.2'
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.17.1
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: 2017-11-05 00:00:00.000000000 Z
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.5.1
144
+ rubygems_version: 2.7.6
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: A simple, extensible health-check monitor