lib/irb/cmd/help.rb in irb-1.1.0 vs lib/irb/cmd/help.rb in irb-1.1.1
- old
+ new
@@ -7,22 +7,21 @@
# --
#
#
#
+require 'rdoc/ri/driver'
+
require_relative "nop"
# :stopdoc:
module IRB
module ExtendCommand
class Help < Nop
- def execute(*names)
- require 'rdoc/ri/driver'
- IRB::ExtendCommand::Help.const_set(:Ri, RDoc::RI::Driver.new)
- rescue LoadError, SystemExit
- IRB::ExtendCommand::Help.remove_method(:execute)
- # raise NoMethodError in ensure
+ begin
+ Ri = RDoc::RI::Driver.new
+ rescue SystemExit
else
def execute(*names)
if names.empty?
Ri.interactive
return
@@ -34,12 +33,9 @@
puts $!.message
end
end
nil
end
- nil
- ensure
- execute(*names)
end
end
end
end
# :startdoc: