Class: HTTY::Rack::CLI
- Inherits:
-
CLI
- Object
- CLI
- HTTY::Rack::CLI
- Defined in:
- lib/htty/rack/cli.rb
Instance Attribute Summary collapse
-
#config_file_name ⇒ Object
Returns the value of attribute config_file_name.
Instance Method Summary collapse
- #command_folders ⇒ Object
-
#initialize(command_line_arguments, session_class = HTTY::Rack::Session) ⇒ CLI
constructor
A new instance of CLI.
- #prompt ⇒ Object
Constructor Details
Instance Attribute Details
#config_file_name ⇒ Object
Returns the value of attribute config_file_name.
4 5 6 |
# File 'lib/htty/rack/cli.rb', line 4 def config_file_name @config_file_name end |
Instance Method Details
#command_folders ⇒ Object
23 24 25 |
# File 'lib/htty/rack/cli.rb', line 23 def command_folders super + ["#{File.dirname __FILE__}/commands"] end |
#prompt ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/htty/rack/cli.rb', line 10 def prompt last_request = session.requests.last if last_request.app.respond_to? :name display = last_request.app.name else display = last_request.app_file end strong(display + ":" + session.requests.last.send(:path_query_and_fragment)) + normal('> ') end |