Module: AppStatus::Checks::RubyVersion
- Defined in:
- lib/app_status/checks/ruby_version.rb
Overview
verify that running ruby version is as expected
Class Method Summary collapse
-
.check(expected_version: nil) ⇒ Object
compare expected ruby version to actual ruby version.
-
.install!(expected_version: nil) ⇒ Object
add a ruby version check to AppStatus::CheckCollection.
Class Method Details
.check(expected_version: nil) ⇒ Object
compare expected ruby version to actual ruby version
28 29 30 31 32 |
# File 'lib/app_status/checks/ruby_version.rb', line 28 def self.check(expected_version: nil) expected_version ||= File.read(Rails.root.join('.ruby-version')).strip status = RUBY_VERSION == expected_version ? :ok : :critical [status, "expected: #{expected_version}, actual: #{RUBY_VERSION}"] end |
.install!(expected_version: nil) ⇒ Object
add a ruby version check to AppStatus::CheckCollection
18 19 20 21 22 |
# File 'lib/app_status/checks/ruby_version.rb', line 18 def self.install!(expected_version: nil) AppStatus::CheckCollection.add_check('ruby_version') do AppStatus::Checks::RubyVersion.check(expected_version: expected_version) end end |