From d5dfc3f2c833d62e4e0fb3145ed729f48b8e2a66 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Thu, 10 Dec 2020 21:04:57 +0900 Subject: Use `abort(message)` instead of `puts` and `exit` --- lib/rdoc/ri/driver.rb | 3 +-- lib/rdoc/servlet.rb | 3 +-- lib/rubygems/server.rb | 3 +-- lib/un.rb | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'lib') 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| -- cgit v1.2.3