Class: Rack::ECG::Check::GitRevision Deprecated
- Inherits:
-
Object
- Object
- Rack::ECG::Check::GitRevision
- Defined in:
- lib/rack/ecg/check/git_revision.rb
Overview
Deprecated.
This check requires the presence of the git executable, and executes it every time to determine the current revision. Consider checking the revision at initialization time, and returning it via a Static check instead.
Instance Method Summary collapse
-
#initialize ⇒ Object
constructor
Returns the SHA1 of the current commit, as reported by the git executable.
- #result ⇒ Object
Constructor Details
#initialize ⇒ Object
Returns the SHA1 of the current commit, as reported by the git executable.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rack/ecg/check/git_revision.rb', line 13 class GitRevision def result _stdin, stdout, stderr, wait_thread = Open3.popen3("git rev-parse HEAD") success = wait_thread.value.success? status = success ? Status::OK : Status::ERROR value = success ? stdout.read : stderr.read value = value.strip Result.new(:git_revision, status, value) end end |
Instance Method Details
#result ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rack/ecg/check/git_revision.rb', line 14 def result _stdin, stdout, stderr, wait_thread = Open3.popen3("git rev-parse HEAD") success = wait_thread.value.success? status = success ? Status::OK : Status::ERROR value = success ? stdout.read : stderr.read value = value.strip Result.new(:git_revision, status, value) end |