Project: Mongrel
Revision: 1032
Author: luislavena
Date: 27 Jul 2008 08:18:23
Changes:Updated RUBY_PLATFORM regexp and Gem::Platforms
Sorta backport from 1.2 to reports about MinGW not being a valid platform.
Files:modified: /branches/stable_1-1/projects/mongrel_config/lib/mongrel_config/init.rb (
try)
modified: /branches/stable_1-1/lib/mongrel/rails.rb (
try)
modified: /branches/stable_1-1/projects/mongrel_config/test/test_config.rb (
try)
modified: /branches/stable_1-1/lib/mongrel/configurator.rb (
try)
modified: /branches/stable_1-1/projects/mongrel_service/Rakefile (
try)
modified: /branches/stable_1-1/projects/mongrel_service/tools/freebasic.rb (
try)
modified: /branches/stable_1-1/Rakefile (
try)
Diff:
| ... | ...@@ -7,7 +7,7 @@ |
| 7 | 7 | include Mongrel::Command::Base |
| 8 | 8 | |
| 9 | 9 | def configure |
| 10 | | if RUBY_PLATFORM =~ /mswin/ |
| 10 | if RUBY_PLATFORM =~ /mswin|mingw/ |
| 11 | 11 | options [ |
| 12 | 12 | ['-h', '--host ADDR', "Host to bind to for server", :@host, "0.0.0.0"], |
| 13 | 13 | ['-p', '--port NUMBER', "Port to bind to", :@port, "3001"], |
| ... | ...@@ -30,7 +30,7 @@ |
| 30 | 30 | valid?(@port && @port.to_i > 0, "Must give a valid port") |
| 31 | 31 | valid?(@host, "Host IP to bind must be given") |
| 32 | 32 | |
| 33 | | if RUBY_PLATFORM !~ /mswin/ |
| 33 | if RUBY_PLATFORM !~ /mswin|mingw/ |
| 34 | 34 | valid_dir? @cwd, "Cannot change to a directory that doesn't exist" |
| 35 | 35 | Dir.chdir @cwd |
| 36 | 36 | valid_dir? "log", "Log directory does not exist" |
| ... | ...@@ -42,7 +42,7 @@ |
| 42 | 42 | |
| 43 | 43 | def run |
| 44 | 44 | # must require this here since rails and camping don't like eachother |
| 45 | | if RUBY_PLATFORM =~ /mswin/ |
| 45 | if RUBY_PLATFORM =~ /mswin|mingw/ |
| 46 | 46 | require 'mongrel_config/win32_app' |
| 47 | 47 | $mongrel_rails_service = @mongrel_script |
| 48 | 48 | else |
| ... | ...@@ -55,7 +55,7 @@ |
| 55 | 55 | $server = Mongrel::Camping::start(@host,@port,@uri,Configure) |
| 56 | 56 | |
| 57 | 57 | puts "** Configure is running at http://#{@host}:#{@port}#{@uri}" |
| 58 | | if RUBY_PLATFORM !~ /mswin/ |
| 58 | if RUBY_PLATFORM !~ /mswin|mingw/ |
| 59 | 59 | trap("INT") { |
| 60 | 60 | $server.stop |
| 61 | 61 | } |
| ... | ...@@ -173,7 +173,7 @@ |
| 173 | 173 | ops = resolve_defaults(options) |
| 174 | 174 | setup_signals(options) |
| 175 | 175 | |
| 176 | | if RUBY_PLATFORM !~ /mswin/ |
| 176 | if RUBY_PLATFORM !~ /mswin|mingw/ |
| 177 | 177 | # rails reload |
| 178 | 178 | trap("HUP") { log "HUP signal received."; reload! } |
| 179 | 179 | |
| ... | ...@@ -14,7 +14,7 @@ |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | # these are only run if we're running on windows |
| 17 | | if RUBY_PLATFORM =~ /mswin/ |
| 17 | if RUBY_PLATFORM =~ /mswin|mingw/ |
| 18 | 18 | require 'mongrel_config/win32' |
| 19 | 19 | |
| 20 | 20 | class Win32Test < Test::Unit::TestCase |
| ... | ...@@ -81,7 +81,7 @@ |
| 81 | 81 | |
| 82 | 82 | # Writes the PID file if we're not on Windows. |
| 83 | 83 | def write_pid_file |
| 84 | | if RUBY_PLATFORM !~ /mswin/ |
| 84 | if RUBY_PLATFORM !~ /mswin|mingw/ |
| 85 | 85 | log "Writing PID file to #{@pid_file}" |
| 86 | 86 | open(@pid_file,"w") {|f| f.write(Process.pid) } |
| 87 | 87 | open(@pid_file,"w") do |f| |
| ... | ...@@ -185,7 +185,7 @@ |
| 185 | 185 | def daemonize(options={}) |
| 186 | 186 | ops = resolve_defaults(options) |
| 187 | 187 | # save this for later since daemonize will hose it |
| 188 | | if RUBY_PLATFORM !~ /mswin/ |
| 188 | if RUBY_PLATFORM !~ /mswin|mingw/ |
| 189 | 189 | require 'daemons/daemonize' |
| 190 | 190 | |
| 191 | 191 | logfile = ops[:log_file] |
| ... | ...@@ -366,7 +366,7 @@ |
| 366 | 366 | # clean up the pid file always |
| 367 | 367 | at_exit { remove_pid_file } |
| 368 | 368 | |
| 369 | | if RUBY_PLATFORM !~ /mswin/ |
| 369 | if RUBY_PLATFORM !~ /mswin|mingw/ |
| 370 | 370 | # graceful shutdown |
| 371 | 371 | trap("TERM") { log "TERM signal received."; stop } |
| 372 | 372 | trap("USR1") { log "USR1 received, toggling $mongrel_debug_client to #{!$mongrel_debug_client}"; $mongrel_debug_client = !$mongrel_debug_client } |
| ... | ...@@ -10,7 +10,7 @@ |
| 10 | 10 | p.summary += " (debug build)" unless ENV['RELEASE'] |
| 11 | 11 | p.description = "This plugin offer native win32 services for rails, powered by Mongrel." |
| 12 | 12 | p.author = "Luis Lavena" |
| 13 | | p.platform = Gem::Platform::WIN32 |
| 13 | p.platform = Gem::Platform::CURRENT |
| 14 | 14 | p.dependencies = ['gem_plugin >=0.2.3', 'mongrel >=1.0.2', 'win32-service >=0.5.0'] |
| 15 | 15 | |
| 16 | 16 | p.executable_pattern = "" |
| ... | ...@@ -39,7 +39,7 @@ |
| 39 | 39 | # this help me reduce the attempts to remove already removed files.
|
| 40 | 40 | # works with src_files
|
| 41 | 41 | CLOBBER = Rake::FileList.new
|
| 42 | | ON_WINDOWS = (RUBY_PLATFORM =~ /mswin|cygwin|bccwin/)
|
| 42 | ON_WINDOWS = (RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin/)
|
| 43 | 43 |
|
| 44 | 44 | class ProjectTask
|
| 45 | 45 | attr_accessor :name
|
| ... | ...@@ -27,13 +27,13 @@ |
| 27 | 27 | p.need_tar_gz = false |
| 28 | 28 | p.need_tgz = true |
| 29 | 29 | |
| 30 | | if RUBY_PLATFORM !~ /mswin|java/ |
| 30 | if RUBY_PLATFORM !~ /mswin|mingw|java/ |
| 31 | 31 | p.extension_pattern = ["ext/**/extconf.rb"] |
| 32 | 32 | end |
| 33 | 33 | |
| 34 | 34 | p.eval = proc do |
| 35 | 35 | case RUBY_PLATFORM |
| 36 | | when /mswin/ |
| 36 | when /mswin|mingw/ |
| 37 | 37 | self.files += ['lib/http11.so'] |
| 38 | 38 | self.platform = Gem::Platform::CURRENT |
| 39 | 39 | add_dependency('cgi_multipart_eof_fix', '>= 2.4') |
| ... | ...@@ -86,7 +86,7 @@ |
| 86 | 86 | end |
| 87 | 87 | |
| 88 | 88 | case RUBY_PLATFORM |
| 89 | | when /mswin/ |
| 89 | when /mswin|mingw/ |
| 90 | 90 | filename = "lib/http11.so" |
| 91 | 91 | file filename do |
| 92 | 92 | Dir.chdir("ext/http11") do |
| ... | ...@@ -164,7 +164,7 @@ |
| 164 | 164 | sub_project("mongrel_console", :install) |
| 165 | 165 | sub_project("mongrel_cluster", :install) |
| 166 | 166 | # sub_project("mongrel_experimental", :install) |
| 167 | | sub_project("mongrel_service", :install) if RUBY_PLATFORM =~ /mswin/ |
| 167 | sub_project("mongrel_service", :install) if RUBY_PLATFORM =~ /mswin|mingw/ |
| 168 | 168 | end |
| 169 | 169 | |
| 170 | 170 | desc "for Mongrel and all its subprojects" |
| ... | ...@@ -176,7 +176,7 @@ |
| 176 | 176 | sub_project("gem_plugin", :uninstall) |
| 177 | 177 | sub_project("fastthread", :uninstall) |
| 178 | 178 | # sub_project("mongrel_experimental", :uninstall) |
| 179 | | sub_project("mongrel_service", :uninstall) if RUBY_PLATFORM =~ /mswin/ |
| 179 | sub_project("mongrel_service", :uninstall) if RUBY_PLATFORM =~ /mswin|mingw/ |
| 180 | 180 | end |
| 181 | 181 | |
| 182 | 182 | desc "for Mongrel and all its subprojects" |
| ... | ...@@ -189,7 +189,7 @@ |
| 189 | 189 | sub_project("mongrel_console", :clean) |
| 190 | 190 | sub_project("mongrel_cluster", :clean) |
| 191 | 191 | sub_project("mongrel_experimental", :clean) |
| 192 | | sub_project("mongrel_service", :clean) if RUBY_PLATFORM =~ /mswin/ |
| 192 | sub_project("mongrel_service", :clean) if RUBY_PLATFORM =~ /mswin|mingw/ |
| 193 | 193 | end |
| 194 | 194 | |
| 195 | 195 | #### Site upload tasks |
To list