Added help message for gem i webrick in gem server command

This commit is contained in:
Hiroshi SHIBATA 2020-11-03 07:14:36 +09:00
parent b084f8abcf
commit 4ccc66265c
Notes: git 2020-12-10 18:06:56 +09:00

View File

@ -1,5 +1,4 @@
# frozen_string_literal: true
require 'webrick'
require 'zlib'
require 'erb'
require 'uri'
@ -424,6 +423,13 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
ERB
def self.run(options)
begin
require 'webrick'
rescue LoadError
puts "webrick is not found. You may need to `gem install webrick` to install webrick."
exit
end
new(options[:gemdir], options[:port], options[:daemon],
options[:launch], options[:addresses]).run
end