Class: HTTY::Rack::CLI

Inherits:
CLI
  • Object
show all
Defined in:
lib/htty/rack/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command_line_arguments, session_class = HTTY::Rack::Session) ⇒ CLI

Returns a new instance of CLI.



6
7
8
# File 'lib/htty/rack/cli.rb', line 6

def initialize(command_line_arguments, session_class = HTTY::Rack::Session)
  super
end

Instance Attribute Details

#config_file_nameObject

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_foldersObject



23
24
25
# File 'lib/htty/rack/cli.rb', line 23

def command_folders
  super + ["#{File.dirname __FILE__}/commands"]
end

#promptObject



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