Class: Peek::Views::AppVersion
- Inherits:
-
View
- Object
- View
- Peek::Views::AppVersion
- Defined in:
- lib/peek/views/app_version.rb
Overview
AppVersion view
Instance Method Summary collapse
-
#app_version ⇒ Object
Return the application version number is set Else, build it from the git tag.
-
#initialize(options = {}) ⇒ AppVersion
constructor
Setting up the peek views Accepted keys in options: - app_name: Name of your Rails application (default: Rails).
Constructor Details
#initialize(options = {}) ⇒ AppVersion
Setting up the peek views Accepted keys in options:
-
app_name: Name of your Rails application (default: Rails)
8 9 10 |
# File 'lib/peek/views/app_version.rb', line 8 def initialize( = {}) @app_name = .delete(:app_name) || Rails end |
Instance Method Details
#app_version ⇒ Object
Return the application version number is set Else, build it from the git tag
14 15 16 |
# File 'lib/peek/views/app_version.rb', line 14 def app_version @app_version ||= (@app_name::VERSION || `git describe --tags`.strip) end |