Class: HTTY::CLI::Commands::Irb

Inherits:
HTTY::CLI::Command
  • Object
show all
Defined in:
lib/htty/rack/commands/irb.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.categoryObject

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_argumentsObject

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

.helpObject

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_extendedObject

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

#performObject

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