summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-10 16:20:21 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-10 18:06:25 +0900
commite7433a3288b48f90447bc8ebb1531f57be17392c (patch)
tree9c1c2397186eae205a046c8cb5cac0e3230dc0ad /lib
parent4ccc66265cdef0480eb6ff46f6be9f8de1a01891 (diff)
Added help message for gem i webrick in rdoc
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3729
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/ri/driver.rb7
-rw-r--r--lib/rdoc/servlet.rb8
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index d5af47bf40..bb7f7f61a6 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -1551,7 +1551,12 @@ or the PAGER environment variable.
# Starts a WEBrick server for ri.
def start_server
- require 'webrick'
+ begin
+ require 'webrick'
+ rescue LoadError
+ puts "webrick is not found. You may need to `gem install webrick` to install webrick."
+ exit
+ end
server = WEBrick::HTTPServer.new :Port => @server
diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb
index e1d0f0ce82..bead186b00 100644
--- a/lib/rdoc/servlet.rb
+++ b/lib/rdoc/servlet.rb
@@ -3,7 +3,13 @@ require 'rdoc'
require 'erb'
require 'time'
require 'json'
-require 'webrick'
+
+begin
+ require 'webrick'
+rescue LoadError
+ puts "webrick is not found. You may need to `gem install webrick` to install webrick."
+ exit
+end
##
# This is a WEBrick servlet that allows you to browse ri documentation.