aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/cmd/help.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/cmd/help.rb')
-rw-r--r--lib/irb/cmd/help.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/irb/cmd/help.rb b/lib/irb/cmd/help.rb
new file mode 100644
index 0000000000..73067f53c6
--- /dev/null
+++ b/lib/irb/cmd/help.rb
@@ -0,0 +1,23 @@
+require 'rdoc/ri/ri_driver'
+
+module IRB
+ module ExtendCommand
+ module Help
+ begin
+ @ri = RiDriver.new
+ rescue SystemExit
+ else
+ def self.execute(context, *names)
+ names.each do |name|
+ begin
+ @ri.get_info_for(name.to_s)
+ rescue RiError
+ puts $!.message
+ end
+ end
+ nil
+ end
+ end
+ end
+ end
+end