aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-04-29 15:49:02 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-04-29 15:49:02 -0700
commit3de6a75d3fb06cc1da9251ed8ce1a11dd433d8cc (patch)
treed54858b0942bf80e040a0a97fe0e74f73adcfc65 /railties
parent75df4c11650a148f6672ce6407b624b840ec7b50 (diff)
parent72a2edd8c308cf63237b9e010f6595fd3ad08463 (diff)
downloadrails-3de6a75d3fb06cc1da9251ed8ce1a11dd433d8cc.tar.gz
rails-3de6a75d3fb06cc1da9251ed8ce1a11dd433d8cc.tar.bz2
rails-3de6a75d3fb06cc1da9251ed8ce1a11dd433d8cc.zip
Merge pull request #6036 from carlosantoniodasilva/routes-reloader-refactor
Remove some warnings and minor refactor in RoutesReloader
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb3
-rw-r--r--railties/lib/rails/application/routes_reloader.rb5
-rw-r--r--railties/test/application/routing_test.rb2
-rw-r--r--railties/test/isolation/abstract_unit.rb2
4 files changed, 4 insertions, 8 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 1680a6ed00..c7b19c964a 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -66,9 +66,10 @@ module Rails
end
end
- attr_accessor :assets, :sandbox, :queue
+ attr_accessor :assets, :sandbox
alias_method :sandbox?, :sandbox
attr_reader :reloaders
+ attr_writer :queue
delegate :default_url_options, :default_url_options=, :to => :routes
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb
index 7f9190b01a..19f616ec50 100644
--- a/railties/lib/rails/application/routes_reloader.rb
+++ b/railties/lib/rails/application/routes_reloader.rb
@@ -24,12 +24,11 @@ module Rails
def updater
@updater ||= begin
- dirs = @external_routes.inject({}) do |hash, dir|
- hash.merge(dir.to_s => ["rb"])
+ dirs = @external_routes.each_with_object({}) do |dir, hash|
+ hash[dir.to_s] = %w(rb)
end
updater = ActiveSupport::FileUpdateChecker.new(paths, dirs) { reload! }
-
updater.execute
updater
end
diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb
index 4560dcec69..977a5fc7e8 100644
--- a/railties/test/application/routing_test.rb
+++ b/railties/test/application/routing_test.rb
@@ -249,9 +249,7 @@ module ApplicationTests
assert_equal 404, last_response.status
end
end
- end
- {"development" => "baz", "production" => "bar"}.each do |mode, expected|
test "reloads routes when configuration is changed in #{mode}" do
controller :foo, <<-RUBY
class FooController < ApplicationController
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 7957186ba2..f2dc0c71b1 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -18,7 +18,6 @@ RAILS_FRAMEWORK_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../..")
# These files do not require any others and are needed
# to run the tests
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/isolation"
-require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/testing/declarative"
require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support/core_ext/kernel/reporting"
module TestHelpers
@@ -268,7 +267,6 @@ class ActiveSupport::TestCase
include TestHelpers::Paths
include TestHelpers::Rack
include TestHelpers::Generation
- extend ActiveSupport::Testing::Declarative
end
# Create a scope and build a fixture rails app