зеркало из https://github.com/github/ruby.git
Use `abort(message)` instead of `puts` and `exit`
This commit is contained in:
Родитель
78f188524f
Коммит
d5dfc3f2c8
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
##
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
Загрузка…
Ссылка в новой задаче