[前][次][番号順一覧][スレッド一覧]

ruby-changes:64065

From: Hiroshi <ko1@a...>
Date: Thu, 10 Dec 2020 18:06:54 +0900 (JST)
Subject: [ruby-changes:64065] e7433a3288 (master): Added help message for gem i webrick in rdoc

https://git.ruby-lang.org/ruby.git/commit/?id=e7433a3288

From e7433a3288b48f90447bc8ebb1531f57be17392c Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Thu, 10 Dec 2020 16:20:21 +0900
Subject: Added help message for gem i webrick in rdoc


diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index d5af47b..bb7f7f6 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -1551,7 +1551,12 @@ or the PAGER environment variable. https://github.com/ruby/ruby/blob/trunk/lib/rdoc/ri/driver.rb#L1551
   # 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 e1d0f0c..bead186 100644
--- a/lib/rdoc/servlet.rb
+++ b/lib/rdoc/servlet.rb
@@ -3,7 +3,13 @@ require 'rdoc' https://github.com/ruby/ruby/blob/trunk/lib/rdoc/servlet.rb#L3
 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.
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]