Class: Command::Version

Inherits:
CommandBase show all
Defined in:
lib/command/version.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CommandBase

execute!, #force_change_settings_function, help, #hook_call, #initialize, #load_local_settings, #tagname_to_ids

Constructor Details

This class inherits a constructor from Command::CommandBase

Class Method Details

.create_version_stringObject



16
17
18
19
20
# File 'lib/command/version.rb', line 16

def self.create_version_string
  cv_path = File.expand_path("commitversion", Narou.get_script_dir)
  commitversion = File.exist?(cv_path) ? File.read(cv_path) : `git describe --always`.strip + "(develop)"
  "#{::Version} build #{commitversion}"
end

.oneline_helpObject



8
9
10
# File 'lib/command/version.rb', line 8

def self.oneline_help
  "バージョンを表示します"
end

Instance Method Details

#execute(argv) ⇒ Object



12
13
14
# File 'lib/command/version.rb', line 12

def execute(argv)
  puts self.class.create_version_string
end