summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2020-12-10 21:04:57 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2020-12-10 21:06:10 +0900
commitd5dfc3f2c833d62e4e0fb3145ed729f48b8e2a66 (patch)
tree0a50f8b82d608fef8172c65b3315d8a06189b535 /lib
parent78f188524f551c97b1a7a44ae13514729f1a21c7 (diff)
downloadruby-d5dfc3f2c833d62e4e0fb3145ed729f48b8e2a66.tar.gz
Use `abort(message)` instead of `puts` and `exit`
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/ri/driver.rb3
-rw-r--r--lib/rdoc/servlet.rb3
-rw-r--r--lib/rubygems/server.rb3
-rw-r--r--lib/un.rb3
4 files changed, 4 insertions, 8 deletions
diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index bb7f7f61a6..a4b70b8f56 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -1554,8 +1554,7 @@ or the PAGER environment variable.
begin
require 'webrick'
rescue LoadError
- puts "webrick is not found. You may need to `gem install webrick` to install webrick."
- exit
+ abort "webrick is not found. You may need to `gem install webrick` to install webrick."
end
server = WEBrick::HTTPServer.new :Port => @server
diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb
index bead186b00..0ab1eaf19d 100644
--- a/lib/rdoc/servlet.rb
+++ b/lib/rdoc/servlet.rb
@@ -7,8 +7,7 @@ require 'json'
begin
require 'webrick'
rescue LoadError
- puts "webrick is not found. You may need to `gem install webrick` to install webrick."
- exit
+ abort "webrick is not found. You may need to `gem install webrick` to install webrick."
end
##
diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb
index 6d472ad02a..2c2805f31c 100644
--- a/lib/rubygems/server.rb
+++ b/lib/rubygems/server.rb
@@ -431,8 +431,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
begin
require 'webrick'
rescue LoadError
- puts "webrick is not found. You may need to `gem install webrick` to install webrick."
- exit
+ abort "webrick is not found. You may need to `gem install webrick` to install webrick."
end
Gem::RDoc.load_rdoc
diff --git a/lib/un.rb b/lib/un.rb
index 39212d0fa9..3f59e3ff8b 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -329,8 +329,7 @@ def httpd
begin
require 'webrick'
rescue LoadError
- puts "webrick is not found. You may need to `gem install webrick` to install webrick."
- exit
+ abort "webrick is not found. You may need to `gem install webrick` to install webrick."
end
opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i
[:Port, :MaxClients].each do |name|