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

.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
15
16
# File 'lib/command/version.rb', line 12

def execute(argv)
  cv_path = File.expand_path("commitversion", Narou.get_script_dir)
  commitversion = File.exist?(cv_path) ? File.read(cv_path) : `git describe --always`.strip + "(develop)"
  puts ::Version + " build " + commitversion
end