Class: HTTY::CLI::Commands::Irb
- Inherits:
-
HTTY::CLI::Command
- Object
- HTTY::CLI::Command
- HTTY::CLI::Commands::Irb
- Defined in:
- lib/htty/rack/commands/irb.rb
Class Method Summary collapse
-
.category ⇒ Object
Returns the name of a category under which help for the irb command should appear.
-
.command_line_arguments ⇒ Object
Returns the arguments for the command-line usage of the irb command.
-
.help ⇒ Object
Returns the help text for the irb command.
-
.help_extended ⇒ Object
Returns the extended help text for the irb command.
Instance Method Summary collapse
-
#perform ⇒ Object
Performs the irb command.
Class Method Details
.category ⇒ Object
Returns the name of a category under which help for the irb command should appear.
5 6 7 |
# File 'lib/htty/rack/commands/irb.rb', line 5 def self.category 'Debug' end |
.command_line_arguments ⇒ Object
Returns the arguments for the command-line usage of the irb command.
10 11 12 |
# File 'lib/htty/rack/commands/irb.rb', line 10 def self.command_line_arguments '' end |
.help ⇒ Object
Returns the help text for the irb command.
15 16 17 |
# File 'lib/htty/rack/commands/irb.rb', line 15 def self.help 'Starts irb' end |
.help_extended ⇒ Object
Returns the extended help text for the irb command.
20 21 22 23 |
# File 'lib/htty/rack/commands/irb.rb', line 20 def self.help_extended 'Starts irb to let you modify the environment. Use it like IRB, using' + '#exit brings you right back.' end |
Instance Method Details
#perform ⇒ Object
Performs the irb command.
26 27 28 29 30 31 32 33 34 |
# File 'lib/htty/rack/commands/irb.rb', line 26 def perform unless arguments.length == 0 raise ArgumentError, "wrong number of arguments (#{arguments.length} for 0)" end require 'irb' IRB::start(__FILE__) end |