Skip to content

Commit

Permalink
Windows: include MinGW in RUBY_PLATFORM check. Closes #2982.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6344 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Mar 6, 2007
1 parent e17df19 commit 8dfe5b7
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN* *SVN*


* Windows: include MinGW in RUBY_PLATFORM check. #2982 [okkez000@gmail.com, Kaspar Schiess]

* Split out the basic plugin locator functionality into an abstract super class. Add a FileSystemLocator to do the job of checking the plugin_paths for plugins. Add plugin_locators configuration option which will iterate over the set of plugin locators and load each of the plugin loaders they return. Rename locater everywhere to locator. [Marcel Molina Jr.] * Split out the basic plugin locator functionality into an abstract super class. Add a FileSystemLocator to do the job of checking the plugin_paths for plugins. Add plugin_locators configuration option which will iterate over the set of plugin locators and load each of the plugin loaders they return. Rename locater everywhere to locator. [Marcel Molina Jr.]


* Split plugin location and loading out of the initializer and into a new Plugin namespace, which includes Plugin::Locater and Plugin::Loader. The loader class that is used can be customized using the config.plugin_loader option. Those monkey patching the plugin loading subsystem take note, the internals changing here will likely break your modifications. The good news is that it should be substantially easier to hook into the plugin locating and loading process now. [Marcel Molina Jr.] * Split plugin location and loading out of the initializer and into a new Plugin namespace, which includes Plugin::Locater and Plugin::Loader. The loader class that is used can be customized using the config.plugin_loader option. Those monkey patching the plugin loading subsystem take note, the internals changing here will likely break your modifications. The good news is that it should be substantially easier to hook into the plugin locating and loading process now. [Marcel Molina Jr.]
Expand Down
4 changes: 2 additions & 2 deletions railties/environments/boot.rb
Expand Up @@ -3,7 +3,7 @@
unless defined?(RAILS_ROOT) unless defined?(RAILS_ROOT)
root_path = File.join(File.dirname(__FILE__), '..') root_path = File.join(File.dirname(__FILE__), '..')


unless RUBY_PLATFORM =~ /mswin32/ unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
require 'pathname' require 'pathname'
root_path = Pathname.new(root_path).cleanpath(true).to_s root_path = Pathname.new(root_path).cleanpath(true).to_s
end end
Expand Down Expand Up @@ -42,4 +42,4 @@
end end


Rails::Initializer.run(:set_load_path) Rails::Initializer.run(:set_load_path)
end end
2 changes: 1 addition & 1 deletion railties/lib/commands/console.rb
@@ -1,4 +1,4 @@
irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb' irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'


require 'optparse' require 'optparse'
options = { :sandbox => false, :irb => irb } options = { :sandbox => false, :irb => irb }
Expand Down
4 changes: 2 additions & 2 deletions railties/lib/commands/process/inspector.rb
@@ -1,6 +1,6 @@
require 'optparse' require 'optparse'


if RUBY_PLATFORM =~ /mswin32/ then abort("Inspector is only for Unix") end if RUBY_PLATFORM =~ /(:?mswin|mingw)/ then abort("Inspector is only for Unix") end


OPTIONS = { OPTIONS = {
:pid_path => File.expand_path(RAILS_ROOT + '/tmp/pids'), :pid_path => File.expand_path(RAILS_ROOT + '/tmp/pids'),
Expand Down Expand Up @@ -65,4 +65,4 @@ def pid_files
opts.parse! opts.parse!
end end


Inspector.inspect(OPTIONS[:pid_path], OPTIONS[:pattern]) Inspector.inspect(OPTIONS[:pid_path], OPTIONS[:pattern])
2 changes: 1 addition & 1 deletion railties/lib/commands/process/reaper.rb
Expand Up @@ -2,7 +2,7 @@
require 'net/http' require 'net/http'
require 'uri' require 'uri'


if RUBY_PLATFORM =~ /mswin32/ then abort("Reaper is only for Unix") end if RUBY_PLATFORM =~ /(:?mswin|mingw)/ then abort("Reaper is only for Unix") end


class Killer class Killer
class << self class << self
Expand Down
4 changes: 2 additions & 2 deletions railties/lib/commands/process/spawner.rb
Expand Up @@ -92,7 +92,7 @@ def self.can_bind_to_custom_address?
else else
if defined?(Mongrel) if defined?(Mongrel)
"mongrel" "mongrel"
elsif RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `spawn-fcgi -version` }.blank? && defined?(FCGI) elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `spawn-fcgi -version` }.blank? && defined?(FCGI)
"fcgi" "fcgi"
end end
end end
Expand Down Expand Up @@ -206,4 +206,4 @@ def self.can_bind_to_custom_address?
end end
else else
spawner_class.spawn_all spawner_class.spawn_all
end end
2 changes: 1 addition & 1 deletion railties/lib/commands/server.rb
Expand Up @@ -19,7 +19,7 @@
else else
if defined?(Mongrel) if defined?(Mongrel)
"mongrel" "mongrel"
elsif RUBY_PLATFORM !~ /mswin/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI) elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI)
"lighttpd" "lighttpd"
else else
"webrick" "webrick"
Expand Down
Expand Up @@ -123,7 +123,7 @@ def add_options!(opt)
end end


def mysql_socket_location def mysql_socket_location
RUBY_PLATFORM =~ /mswin32/ ? MYSQL_SOCKET_LOCATIONS.find { |f| File.exists?(f) } : nil MYSQL_SOCKET_LOCATIONS.find { |f| File.exists?(f) } unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
end end




Expand Down
2 changes: 1 addition & 1 deletion railties/lib/tasks/testing.rake
Expand Up @@ -30,7 +30,7 @@ end
module Kernel module Kernel
def silence_stderr def silence_stderr
old_stderr = STDERR.dup old_stderr = STDERR.dup
STDERR.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') STDERR.reopen(RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'NUL:' : '/dev/null')
STDERR.sync = true STDERR.sync = true
yield yield
ensure ensure
Expand Down

0 comments on commit 8dfe5b7

Please sign in to comment.