2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
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'
|
2004-02-05 19:16:50 -05:00
|
|
|
|
2009-07-21 08:41:01 -04:00
|
|
|
require "irb/cmd/nop.rb"
|
|
|
|
|
2012-12-13 00:22:30 -05:00
|
|
|
# :stopdoc:
|
2004-02-05 19:16:50 -05:00
|
|
|
module IRB
|
|
|
|
module ExtendCommand
|
2016-10-07 01:18:57 -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)
|
2010-04-07 18:16:47 -04:00
|
|
|
if names.empty?
|
|
|
|
Ri.interactive
|
|
|
|
return
|
|
|
|
end
|
2004-02-05 19:16:50 -05:00
|
|
|
names.each do |name|
|
|
|
|
begin
|
2011-06-29 09:51:30 -04:00
|
|
|
Ri.display_name(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
|
2012-12-13 00:22:30 -05:00
|
|
|
# :startdoc:
|