diff options
Diffstat (limited to 'lib/rack/server.rb')
-rw-r--r-- | lib/rack/server.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rack/server.rb b/lib/rack/server.rb index 690f1096..ce965144 100644 --- a/lib/rack/server.rb +++ b/lib/rack/server.rb @@ -1,4 +1,5 @@ require 'optparse' +require 'fileutils' module Rack @@ -46,7 +47,7 @@ module Rack opts.separator "" opts.separator "Rack options:" - opts.on("-s", "--server SERVER", "serve using SERVER (thin/puma/webrick/mongrel)") { |s| + opts.on("-s", "--server SERVER", "serve using SERVER (thin/puma/webrick)") { |s| options[:server] = s } @@ -359,7 +360,7 @@ module Rack def write_pid ::File.open(options[:pid], ::File::CREAT | ::File::EXCL | ::File::WRONLY ){ |f| f.write("#{Process.pid}") } - at_exit { ::File.delete(options[:pid]) if ::File.exist?(options[:pid]) } + at_exit { ::FileUtils.rm_f(options[:pid]) } rescue Errno::EEXIST check_pid! retry |