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

ruby-changes:64058

From: Hiroshi <ko1@a...>
Date: Thu, 10 Dec 2020 18:06:46 +0900 (JST)
Subject: [ruby-changes:64058] 880727f037 (master): Added help message for gem i webrick in un.rb

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

From 880727f037ee7dfeeb3dbc9027622798d46fdbac Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Mon, 2 Nov 2020 20:02:12 +0900
Subject: Added help message for gem i webrick in un.rb


diff --git a/lib/un.rb b/lib/un.rb
index a759328..39212d0 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -326,7 +326,12 @@ def httpd https://github.com/ruby/ruby/blob/trunk/lib/un.rb#L326
         "ServerName=NAME", "ServerSoftware=NAME",
         "SSLCertificate=CERT", "SSLPrivateKey=KEY") do
     |argv, options|
-    require 'webrick'
+    begin
+      require 'webrick'
+    rescue LoadError
+      puts "webrick is not found. You may need to `gem install webrick` to install webrick."
+      exit
+    end
     opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i
     [:Port, :MaxClients].each do |name|
       opt = options[name] and (options[name] = Integer(opt)) rescue nil
-- 
cgit v0.10.2


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

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