Class: Rosette::CLI

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.commandObject (readonly)

Returns the value of attribute command.



10
11
12
# File 'lib/rosette/cli.rb', line 10

def command
  @command
end

.promptObject (readonly)

Returns the value of attribute prompt.



10
11
12
# File 'lib/rosette/cli.rb', line 10

def prompt
  @prompt
end

Class Method Details

.runObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rosette/cli.rb', line 14

def run
  loop do
    ask_for_command
    return exit 0 if exit_cli?

    next display_help if help?
    next normalize! if normalize?

    ask_for_key
    send command
  end
end