Class: HTTY::CLI::Commands::Config
- Inherits:
-
HTTY::CLI::Command
- Object
- HTTY::CLI::Command
- HTTY::CLI::Commands::Config
- Includes:
- HTTY::CLI::CookieClearingCommand
- Defined in:
- lib/htty/rack/commands/config.rb
Class Method Summary collapse
-
.category ⇒ Object
Returns the name of a category under which help for the config command should appear.
-
.command_line_arguments ⇒ Object
Returns the arguments for the command-line usage of the config command.
-
.help ⇒ Object
Returns the help text for the config command.
-
.help_extended ⇒ Object
Returns the extended help text for the config command.
Instance Method Summary collapse
-
#perform ⇒ Object
Performs the config command.
Class Method Details
.category ⇒ Object
Returns the name of a category under which help for the config command should appear.
7 8 9 |
# File 'lib/htty/rack/commands/config.rb', line 7 def self.category 'Rack' end |
.command_line_arguments ⇒ Object
Returns the arguments for the command-line usage of the config command.
12 13 14 |
# File 'lib/htty/rack/commands/config.rb', line 12 def self.command_line_arguments 'config' end |
.help ⇒ Object
Returns the help text for the config command.
17 18 19 |
# File 'lib/htty/rack/commands/config.rb', line 17 def self.help 'Loads a new config' end |
.help_extended ⇒ Object
Returns the extended help text for the config command.
22 23 24 25 |
# File 'lib/htty/rack/commands/config.rb', line 22 def self.help_extended 'Loads a config (.ru-File) and sets the built class as the' + 'active application. This operation clears cookies.' end |
Instance Method Details
#perform ⇒ Object
Performs the config command.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/htty/rack/commands/config.rb', line 28 def perform unless arguments.length == 1 raise ArgumentError, "wrong number of arguments (#{arguments.length} for 1)" end add_request_if_has_response do |request| request.app_file, request.app = HTTY::Rack::build_app arguments.first request end end |