diff options
| author | Xavier Noria <fxn@hashref.com> | 2010-04-28 13:41:21 -0700 |
|---|---|---|
| committer | Xavier Noria <fxn@hashref.com> | 2010-04-28 13:41:21 -0700 |
| commit | b9ab4c780af82c1c60d63c50f040a55da5bfa8db (patch) | |
| tree | 4df8981047957fce17c10ea5c6aac7955aef2a4d /railties/lib/rails/engine.rb | |
| parent | 8f1a5bfee1305f193bb659c010ca7e2272c12051 (diff) | |
| parent | 22184930ea323872c73542767d447bbbd7878c96 (diff) | |
| download | rails-b9ab4c780af82c1c60d63c50f040a55da5bfa8db.tar.gz rails-b9ab4c780af82c1c60d63c50f040a55da5bfa8db.tar.bz2 rails-b9ab4c780af82c1c60d63c50f040a55da5bfa8db.zip | |
Merge commit 'rails/master'
Diffstat (limited to 'railties/lib/rails/engine.rb')
| -rw-r--r-- | railties/lib/rails/engine.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 0f33b40a13..36fcc896ae 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -1,6 +1,7 @@ require 'rails/railtie' require 'active_support/core_ext/module/delegation' require 'pathname' +require 'rbconfig' module Rails # Rails::Engine allows you to wrap a specific Rails application and share it accross @@ -119,7 +120,7 @@ module Rails root = File.exist?("#{root_path}/#{flag}") ? root_path : default raise "Could not find root path for #{self}" unless root - RUBY_PLATFORM =~ /mswin|mingw/ ? + Config::CONFIG['host_os'] =~ /mswin|mingw/ ? Pathname.new(root).expand_path : Pathname.new(root).realpath end end @@ -166,7 +167,7 @@ module Rails paths.app.controllers.to_a.each do |load_path| load_path = File.expand_path(load_path) Dir["#{load_path}/*/**/*_controller.rb"].collect do |path| - namespace = File.dirname(path).sub(/#{load_path}\/?/, '') + namespace = File.dirname(path).sub(/#{Regexp.escape(load_path)}\/?/, '') app.routes.controller_namespaces << namespace unless namespace.empty? end end |
