class MenuCommander::Command
Attributes
last_command[R]
Public Instance Methods
run()
click to toggle source
# File lib/menu_commander/command.rb, line 23 def run verify_sanity say "#{menu.options.header}\n" if menu.options.header success = true if args['--loop'] run_looped_menu else success = run_menu end success ? 0 : 1 end
Private Instance Methods
config()
click to toggle source
# File lib/menu_commander/command.rb, line 103 def config result = args['CONFIG'] || 'menu' result += ".yml" unless result.end_with?('.yml') result end
prompt()
click to toggle source
# File lib/menu_commander/command.rb, line 109 def prompt @prompt ||= TTY::Prompt.new end
verify_sanity()
click to toggle source
# File lib/menu_commander/command.rb, line 43 def verify_sanity raise Exit, VERSION if args['--version'] raise MenuNotFound.new(paths: menu_paths, config: config) unless menu_file end