Class: MenuCommander::Command

Inherits:
MisterBin::Command
  • Object
show all
Includes:
Colsole
Defined in:
lib/menu_commander/command.rb

Instance Method Summary collapse

Instance Method Details

#commandObject



28
29
30
# File 'lib/menu_commander/command.rb', line 28

def command
  @command ||= menu.call
end


24
25
26
# File 'lib/menu_commander/command.rb', line 24

def menu
  @menu ||= Menu.new menu_file
end

#runObject

Raises:



14
15
16
17
18
19
20
21
22
# File 'lib/menu_commander/command.rb', line 14

def run
  raise MenuNotFound.new(paths: menu_paths, config: config) unless menu_file

  if args['--dry']
    say "$ !txtpur!#{command}"
  else
    exec command
  end
end