Module: AppRevision
- Defined in:
- lib/app_revision.rb,
lib/app_revision/version.rb
Overview
Returns the current application git commit SHA. Will look first in the APP_REVISION environment variable, then in the REVISION file written by Capsitrano, then in the Git history and lastly will return ‘unknown’ will be returned
Constant Summary collapse
- ENV_VARS =
['APP_REVISION', 'HEROKU_REVISION']
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.current ⇒ Object
Calls ‘determine_current` with memoization.
-
.determine_current ⇒ Object
Performs version detection in the following order: APP_REVISION -> REVISION file -> git -> “unknown” and returns the current commit/revision SHA as a String.
Class Method Details
.current ⇒ Object
Calls ‘determine_current` with memoization.
10 11 12 |
# File 'lib/app_revision.rb', line 10 def self.current @current ||= determine_current end |
.determine_current ⇒ Object
Performs version detection in the following order: APP_REVISION -> REVISION file -> git -> “unknown” and returns the current commit/revision SHA as a String
17 18 19 20 |
# File 'lib/app_revision.rb', line 17 def self.determine_current detected_rev_str = read_from_env || read_from_revision_file || determine_from_git_rev || unknown_revision up_to_newline(detected_rev_str) end |