Class: Bookbinder::Commands::Version

Inherits:
Object
  • Object
show all
Includes:
Naming
Defined in:
lib/bookbinder/commands/version.rb

Instance Method Summary collapse

Methods included from Naming

#command_for?, #command_type, #flag?

Constructor Details

#initialize(logger) ⇒ Version

Returns a new instance of Version.



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

def initialize(logger)
  @logger = logger
end

Instance Method Details

#runObject



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

def run(*)
  root = File.expand_path('../../../../', __FILE__)
  @logger.log "bookbinder #{Gem::Specification::load(File.join root, "bookbinder.gemspec").version}"
  0
end

#usageObject



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

def usage
  [command_name, "Print the version of bookbinder"]
end