diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb index 90c8400c1118ab75127faa26a162b9201ef5a434..28f8ce3d536299be4ddbafe5cc6e53d23901733b 100644 --- a/actionpack/lib/action_controller/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatcher.rb @@ -39,7 +39,7 @@ def dispatch(cgi = nil, session_options = CgiRequest::DEFAULT_SESSION_OPTIONS, o # Add a preparation callback. Preparation callbacks are run before every # request in development mode, and before the first request in production # mode. - # + # # An optional identifier may be supplied for the callback. If provided, # to_prepare may be called again with the same identifier to replace the # existing callback. Passing an identifier is a suggested practice if the @@ -144,6 +144,7 @@ def reload_application Routing::Routes.reload ActionController::Base.view_paths.reload! + ActionView::Helpers::AssetTagHelper::AssetTag::Cache.clear end # Cleanup the application by clearing out loaded classes so they can diff --git a/actionpack/test/controller/dispatcher_test.rb b/actionpack/test/controller/dispatcher_test.rb index 911fcab67b3945da112de315f552a4c0e8162c04..3ee78a6156b5b1e603561fc394f0890c5ba44296 100644 --- a/actionpack/test/controller/dispatcher_test.rb +++ b/actionpack/test/controller/dispatcher_test.rb @@ -26,9 +26,17 @@ def teardown end def test_clears_dependencies_after_dispatch_if_in_loading_mode - ActionController::Routing::Routes.expects(:reload).once ActiveSupport::Dependencies.expects(:clear).once + dispatch(@output, false) + end + + def test_reloads_routes_before_dispatch_if_in_loading_mode + ActionController::Routing::Routes.expects(:reload).once + dispatch(@output, false) + end + def test_clears_asset_tag_cache_before_dispatch_if_in_loading_mode + ActionView::Helpers::AssetTagHelper::AssetTag::Cache.expects(:clear).once dispatch(@output, false) end diff --git a/activesupport/lib/active_support/vendor.rb b/activesupport/lib/active_support/vendor.rb index c703ac0f3e76226583e826157966cb429c272ba8..633eb2ef08866e0c8de1059fb2db3a6c704ba8ed 100644 --- a/activesupport/lib/active_support/vendor.rb +++ b/activesupport/lib/active_support/vendor.rb @@ -22,7 +22,7 @@ begin gem 'tzinfo', '~> 0.3.11' rescue Gem::LoadError - $:.unshift "#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.9" + $:.unshift "#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.11" end # TODO I18n gem has not been released yet diff --git a/railties/lib/rails/gem_dependency.rb b/railties/lib/rails/gem_dependency.rb index 80481859e17a75cbd64f26bd25a6b56c78c96ffb..46d5fd3a47adeb9924db480d278a5c0a513bfe2c 100644 --- a/railties/lib/rails/gem_dependency.rb +++ b/railties/lib/rails/gem_dependency.rb @@ -151,7 +151,7 @@ def unpack_to(directory) end # Gem.activate changes the spec - get the original - real_spec = Gem::Specification.load(spec.loaded_from) + real_spec = Gem::Specification.load(specification.loaded_from) write_spec(directory, real_spec) end diff --git a/railties/lib/tasks/gems.rake b/railties/lib/tasks/gems.rake index c65dfc7dd45c0cbeca6d19a960729b1100d7bf4b..e2cb4b9577f26c0bc82dc52c985bb54bcf11b92e 100644 --- a/railties/lib/tasks/gems.rake +++ b/railties/lib/tasks/gems.rake @@ -11,7 +11,7 @@ end def print_gem_status(gem, indent=1) code = gem.loaded? ? (gem.frozen? ? "F" : "I") : " " puts " "*(indent-1)+" - [#{code}] #{gem.name} #{gem.requirement.to_s}" - gem.dependencies.each { |g| print_gem_status(g, indent+1)} + gem.dependencies.each { |g| print_gem_status(g, indent+1)} if gem.loaded? end namespace :gems do @@ -70,6 +70,7 @@ namespace :gems do task :refresh_specs => :base do require 'rubygems' require 'rubygems/gem_runner' + Rails::VendorGemSourceIndex.silence_spec_warnings = true Rails.configuration.gems.each do |gem| next unless gem.frozen? && (ENV['GEM'].blank? || ENV['GEM'] == gem.name) gem.refresh_spec(Rails::GemDependency.unpacked_path) if gem.loaded?