Class: Peek::Views::AppVersion

Inherits:
View
  • Object
show all
Defined in:
lib/peek/views/app_version.rb

Overview

AppVersion view

Instance Method Summary collapse

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(options = {})
  @app_name = options.delete(:app_name) || Rails
end

Instance Method Details

#app_versionObject

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