Class: OkComputer::AppVersionCheck
- Defined in:
- lib/ok_computer/built_in_checks/app_version_check.rb
Overview
Display app version SHA
-
If ‘ENV` is set, uses that value.
-
Otherwise, checks for Capistrano’s REVISION file in the app root.
-
Failing these, the check fails
Constant Summary
Constants inherited from Check
Instance Attribute Summary
Attributes inherited from Check
#failure_occurred, #message, #registrant_name, #time
Instance Method Summary collapse
-
#check ⇒ Object
Public: Return the application version.
-
#version ⇒ Object
Public: The application version.
Methods inherited from Check
#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking
Instance Method Details
#check ⇒ Object
Public: Return the application version
9 10 11 12 13 14 |
# File 'lib/ok_computer/built_in_checks/app_version_check.rb', line 9 def check "Version: #{version}" rescue UnknownRevision mark_failure "Unable to determine version" end |
#version ⇒ Object
Public: The application version
Returns a String
19 20 21 |
# File 'lib/ok_computer/built_in_checks/app_version_check.rb', line 19 def version version_from_env || version_from_file || raise(UnknownRevision) end |