Class: HTTY::CLI::Commands::Require
- Inherits:
-
HTTY::CLI::Command
- Object
- HTTY::CLI::Command
- HTTY::CLI::Commands::Require
- Defined in:
- lib/htty/rack/commands/require.rb
Class Method Summary collapse
-
.category ⇒ Object
Returns the name of a category under which help for the require command should appear.
-
.command_line_arguments ⇒ Object
Returns the arguments for the command-line usage of the require command.
-
.help ⇒ Object
Returns the help text for the require command.
-
.help_extended ⇒ Object
Returns the extended help text for the require command.
Instance Method Summary collapse
-
#perform ⇒ Object
Performs the require command.
Class Method Details
.category ⇒ Object
Returns the name of a category under which help for the require command should appear.
5 6 7 |
# File 'lib/htty/rack/commands/require.rb', line 5 def self.category 'Rack' end |
.command_line_arguments ⇒ Object
Returns the arguments for the command-line usage of the require command.
10 11 12 |
# File 'lib/htty/rack/commands/require.rb', line 10 def self.command_line_arguments 'file' end |
.help ⇒ Object
Returns the help text for the require command.
15 16 17 |
# File 'lib/htty/rack/commands/require.rb', line 15 def self.help 'requires a file' end |
.help_extended ⇒ Object
Returns the extended help text for the require command.
20 21 22 23 |
# File 'lib/htty/rack/commands/require.rb', line 20 def self.help_extended 'allows you to require a file. Works like rubys require and allows you' + 'to load apps.' end |
Instance Method Details
#perform ⇒ Object
Performs the require command.
26 27 28 29 30 31 32 33 |
# File 'lib/htty/rack/commands/require.rb', line 26 def perform unless arguments.length == 1 raise ArgumentError, "wrong number of arguments (#{arguments.length} for 1)" end require arguments.first end |