class GGem::CLI::InvalidCommand
Attributes
clirb[R]
name[R]
Public Class Methods
new(name)
click to toggle source
# File lib/ggem/cli/commands.rb, line 15 def initialize(name) @name = name @clirb = CLIRB.new end
Public Instance Methods
help()
click to toggle source
# File lib/ggem/cli/commands.rb, line 30 def help "Usage: ggem [COMMAND] [options]\n\n" \ "Options: #{@clirb}\n" \ "Commands:\n" \ "#{COMMANDS.to_s.split("\n").map{ |l| " #{l}" }.join("\n")}\n" end
new()
click to toggle source
# File lib/ggem/cli/commands.rb, line 20 def new self end
run(argv)
click to toggle source
# File lib/ggem/cli/commands.rb, line 24 def run(argv) @clirb.parse!([@name, argv].flatten.compact) raise CLIRB::HelpExit if @name.to_s.empty? raise InvalidCommandError, "`#{name}` is not a command." end