mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Improved Windows platform detection
Usage of RbConfig::CONFIG['host_os'] instead of RUBY_PLATFORM. This change improves JRuby support for Mongrel in general.
This commit is contained in:
parent
c79c3b786a
commit
c3d8b189d3
5 changed files with 7 additions and 6 deletions
|
@ -5,6 +5,7 @@ Improvements:
|
||||||
* Ruby 1.9 early compatbility: Merged commits form Eric Wong and Matt Aimonetti.
|
* Ruby 1.9 early compatbility: Merged commits form Eric Wong and Matt Aimonetti.
|
||||||
* Better RubyGems support thanks to added env she-bang to mongrel_rails executable.
|
* Better RubyGems support thanks to added env she-bang to mongrel_rails executable.
|
||||||
* Smartly load http11 extension using fat-binary approach.
|
* Smartly load http11 extension using fat-binary approach.
|
||||||
|
* Better detection of Windows platform (usage of RbConfig::CONFIG instead of RUBY_PLATFORM)
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ module Mongrel
|
||||||
config.join
|
config.join
|
||||||
|
|
||||||
if config.needs_restart
|
if config.needs_restart
|
||||||
if RUBY_PLATFORM !~ /mswin/
|
unless RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
||||||
cmd = "ruby #{__FILE__} start #{original_args.join(' ')}"
|
cmd = "ruby #{__FILE__} start #{original_args.join(' ')}"
|
||||||
config.log "Restarting with arguments: #{cmd}"
|
config.log "Restarting with arguments: #{cmd}"
|
||||||
config.stop(false, true)
|
config.stop(false, true)
|
||||||
|
|
|
@ -81,7 +81,7 @@ module Mongrel
|
||||||
|
|
||||||
# Writes the PID file if we're not on Windows.
|
# Writes the PID file if we're not on Windows.
|
||||||
def write_pid_file
|
def write_pid_file
|
||||||
if RUBY_PLATFORM !~ /mingw|mswin/
|
unless RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
||||||
log "Writing PID file to #{@pid_file}"
|
log "Writing PID file to #{@pid_file}"
|
||||||
open(@pid_file,"w") {|f| f.write(Process.pid) }
|
open(@pid_file,"w") {|f| f.write(Process.pid) }
|
||||||
open(@pid_file,"w") do |f|
|
open(@pid_file,"w") do |f|
|
||||||
|
@ -185,7 +185,7 @@ module Mongrel
|
||||||
def daemonize(options={})
|
def daemonize(options={})
|
||||||
ops = resolve_defaults(options)
|
ops = resolve_defaults(options)
|
||||||
# save this for later since daemonize will hose it
|
# save this for later since daemonize will hose it
|
||||||
if RUBY_PLATFORM !~ /mingw|mswin/
|
unless RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
||||||
require 'daemons/daemonize'
|
require 'daemons/daemonize'
|
||||||
|
|
||||||
logfile = ops[:log_file]
|
logfile = ops[:log_file]
|
||||||
|
@ -366,7 +366,7 @@ module Mongrel
|
||||||
# clean up the pid file always
|
# clean up the pid file always
|
||||||
at_exit { remove_pid_file }
|
at_exit { remove_pid_file }
|
||||||
|
|
||||||
if RUBY_PLATFORM !~ /mingw|mswin/
|
unless RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
||||||
# graceful shutdown
|
# graceful shutdown
|
||||||
trap("TERM") { log "TERM signal received."; stop }
|
trap("TERM") { log "TERM signal received."; stop }
|
||||||
trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client }
|
trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client }
|
||||||
|
|
|
@ -173,7 +173,7 @@ module Mongrel
|
||||||
ops = resolve_defaults(options)
|
ops = resolve_defaults(options)
|
||||||
setup_signals(options)
|
setup_signals(options)
|
||||||
|
|
||||||
if RUBY_PLATFORM !~ /mingw|mswin/
|
unless RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
||||||
# rails reload
|
# rails reload
|
||||||
trap("HUP") { log "HUP signal received."; reload! }
|
trap("HUP") { log "HUP signal received."; reload! }
|
||||||
|
|
||||||
|
|
|
@ -67,5 +67,5 @@ end
|
||||||
|
|
||||||
# Platform check helper ;-)
|
# Platform check helper ;-)
|
||||||
def windows?
|
def windows?
|
||||||
result = RUBY_PLATFORM =~ /mingw|mswin/
|
@windows ||= RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue