Class: SemverDialects::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/semver_dialects/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Constant Summary collapse

Error =

Error raised by this runner

Class.new(StandardError)

Instance Method Summary collapse

Instance Method Details

#check_version(type, version, constraint) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/semver_dialects/cli.rb', line 24

def check_version(type, version, constraint)
  if options[:help]
    invoke :help, ['check_version']
  else
    require_relative 'commands/check_version'
    ecode = SemverDialects::Commands::CheckVersion.new(type, version, constraint, options).execute
    exit(ecode)
  end
end

#versionObject



15
16
17
18
# File 'lib/semver_dialects/cli.rb', line 15

def version
  require_relative 'version'
  puts "v#{SemverDialects::VERSION}"
end