diff --git a/railties/CHANGELOG b/railties/CHANGELOG index ba4f7bdf81..d95b7d80a8 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *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 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.] diff --git a/railties/environments/boot.rb b/railties/environments/boot.rb index 1e2a641823..b7af0c35c7 100644 --- a/railties/environments/boot.rb +++ b/railties/environments/boot.rb @@ -3,7 +3,7 @@ unless defined?(RAILS_ROOT) root_path = File.join(File.dirname(__FILE__), '..') - unless RUBY_PLATFORM =~ /mswin32/ + unless RUBY_PLATFORM =~ /(:?mswin|mingw)/ require 'pathname' root_path = Pathname.new(root_path).cleanpath(true).to_s end @@ -42,4 +42,4 @@ end Rails::Initializer.run(:set_load_path) -end \ No newline at end of file +end diff --git a/railties/lib/commands/console.rb b/railties/lib/commands/console.rb index 5abdb49273..dab84c5de3 100644 --- a/railties/lib/commands/console.rb +++ b/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' options = { :sandbox => false, :irb => irb } diff --git a/railties/lib/commands/process/inspector.rb b/railties/lib/commands/process/inspector.rb index 79e1cf9a61..8a6437e715 100644 --- a/railties/lib/commands/process/inspector.rb +++ b/railties/lib/commands/process/inspector.rb @@ -1,6 +1,6 @@ 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 = { :pid_path => File.expand_path(RAILS_ROOT + '/tmp/pids'), @@ -65,4 +65,4 @@ def pid_files opts.parse! end -Inspector.inspect(OPTIONS[:pid_path], OPTIONS[:pattern]) \ No newline at end of file +Inspector.inspect(OPTIONS[:pid_path], OPTIONS[:pattern]) diff --git a/railties/lib/commands/process/reaper.rb b/railties/lib/commands/process/reaper.rb index 4402b57faf..95175d41e0 100644 --- a/railties/lib/commands/process/reaper.rb +++ b/railties/lib/commands/process/reaper.rb @@ -2,7 +2,7 @@ require 'net/http' 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 << self diff --git a/railties/lib/commands/process/spawner.rb b/railties/lib/commands/process/spawner.rb index c8ca1d04a2..0a34bd6e4b 100644 --- a/railties/lib/commands/process/spawner.rb +++ b/railties/lib/commands/process/spawner.rb @@ -92,7 +92,7 @@ def self.can_bind_to_custom_address? else if defined?(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" end end @@ -206,4 +206,4 @@ def self.can_bind_to_custom_address? end else spawner_class.spawn_all -end \ No newline at end of file +end diff --git a/railties/lib/commands/server.rb b/railties/lib/commands/server.rb index 23ad9de324..f84db9c049 100644 --- a/railties/lib/commands/server.rb +++ b/railties/lib/commands/server.rb @@ -19,7 +19,7 @@ else if defined?(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" else "webrick" diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index 06c4b0ce28..742a56e843 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -123,7 +123,7 @@ def add_options!(opt) end 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 diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake index ba50a365c3..b9df35c6b4 100644 --- a/railties/lib/tasks/testing.rake +++ b/railties/lib/tasks/testing.rake @@ -30,7 +30,7 @@ end module Kernel def silence_stderr old_stderr = STDERR.dup - STDERR.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null') + STDERR.reopen(RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'NUL:' : '/dev/null') STDERR.sync = true yield ensure