2005-04-14 05:58:18 -04:00
|
|
|
#
|
|
|
|
# help.rb - helper using ri
|
2009-07-07 07:36:20 -04:00
|
|
|
# $Release Version: 0.9.6$
|
2005-04-14 05:58:18 -04:00
|
|
|
# $Revision$
|
|
|
|
#
|
|
|
|
# --
|
|
|
|
#
|
2009-03-05 22:56:38 -05:00
|
|
|
#
|
2005-04-14 05:58:18 -04:00
|
|
|
#
|
|
|
|
|
2008-03-12 14:13:48 -04:00
|
|
|
require 'rdoc/ri/driver'
|
|
|
|
require 'rdoc/ri/util'
|
2004-02-05 19:16:50 -05:00
|
|
|
|
2009-07-21 08:41:01 -04:00
|
|
|
require "irb/cmd/nop.rb"
|
|
|
|
|
2004-02-05 19:16:50 -05:00
|
|
|
module IRB
|
|
|
|
module ExtendCommand
|
2009-07-21 08:41:01 -04:00
|
|
|
class Help<Nop
|
2004-02-05 19:16:50 -05:00
|
|
|
begin
|
2009-07-21 08:41:01 -04:00
|
|
|
Ri = RDoc::RI::Driver.new
|
2004-02-05 19:16:50 -05:00
|
|
|
rescue SystemExit
|
|
|
|
else
|
2009-07-21 08:41:01 -04:00
|
|
|
def execute(*names)
|
2004-02-05 19:16:50 -05:00
|
|
|
names.each do |name|
|
|
|
|
begin
|
2009-07-21 08:41:01 -04:00
|
|
|
Ri.get_info_for(name.to_s)
|
2008-03-12 14:13:48 -04:00
|
|
|
rescue RDoc::RI::Error
|
2004-02-05 19:16:50 -05:00
|
|
|
puts $!.message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|