aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-10-14 09:47:49 +0200
committerJosé Valim <jose.valim@gmail.com>2010-10-14 09:47:49 +0200
commit01ab6f961bff150d50c99f03fa3946f48ac29b17 (patch)
tree01074398b0f2ffbeaf5d5e44ba7d22f7b7abadeb /actionpack
parentaa508c9baf031d0bb28e6e8f061d731cdd77ecbd (diff)
downloadrails-01ab6f961bff150d50c99f03fa3946f48ac29b17.tar.gz
rails-01ab6f961bff150d50c99f03fa3946f48ac29b17.tar.bz2
rails-01ab6f961bff150d50c99f03fa3946f48ac29b17.zip
Remove :cache => true on lookup templates initialization.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/lookup_context.rb2
-rw-r--r--actionpack/lib/action_view/renderer/template_renderer.rb2
-rw-r--r--actionpack/lib/action_view/template.rb9
-rw-r--r--actionpack/lib/action_view/template/inline.rb20
-rw-r--r--actionpack/test/controller/new_base/render_once_test.rb11
-rw-r--r--actionpack/test/template/lookup_context_test.rb4
-rw-r--r--actionpack/test/template/template_test.rb8
7 files changed, 3 insertions, 53 deletions
diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb
index 80451798b1..27f94a73a6 100644
--- a/actionpack/lib/action_view/lookup_context.rb
+++ b/actionpack/lib/action_view/lookup_context.rb
@@ -61,7 +61,7 @@ module ActionView
def initialize(view_paths, details = {})
@details, @details_key = { :handlers => default_handlers }, nil
@frozen_formats, @skip_default_locale = false, false
- @cache = details.key?(:cache) ? details.delete(:cache) : true
+ @cache = true
self.view_paths = view_paths
self.registered_detail_setters.each do |key, setter|
diff --git a/actionpack/lib/action_view/renderer/template_renderer.rb b/actionpack/lib/action_view/renderer/template_renderer.rb
index 34b2f26199..36beb5c8d0 100644
--- a/actionpack/lib/action_view/renderer/template_renderer.rb
+++ b/actionpack/lib/action_view/renderer/template_renderer.rb
@@ -46,7 +46,7 @@ module ActionView
with_fallbacks { find_template(options[:file], options[:prefix], false, keys) }
elsif options.key?(:inline)
handler = Template.handler_class_for_extension(options[:type] || "erb")
- Template::Inline.new(options[:inline], handler, :locals => keys)
+ Template.new(options[:inline], "inline template", handler, :locals => keys)
elsif options.key?(:template)
options[:template].respond_to?(:render) ?
options[:template] : find_template(options[:template], options[:prefix], false, keys)
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 3ba18cbfae..7dd8acf37b 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -93,7 +93,6 @@ module ActionView
autoload :Error
autoload :Handler
autoload :Handlers
- autoload :Inline
autoload :Text
end
@@ -185,14 +184,6 @@ module ActionView
end
end
- def hash
- identifier.hash
- end
-
- def eql?(other)
- other.is_a?(Template) && other.identifier == identifier
- end
-
def inspect
@inspect ||=
if defined?(Rails.root)
diff --git a/actionpack/lib/action_view/template/inline.rb b/actionpack/lib/action_view/template/inline.rb
deleted file mode 100644
index be08065b6b..0000000000
--- a/actionpack/lib/action_view/template/inline.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'digest/md5'
-
-module ActionView
- class Template
- class Inline < ::ActionView::Template
- def initialize(source, handler, options={})
- super(source, "inline template", handler, options)
- end
-
- def md5_source
- @md5_source ||= Digest::MD5.hexdigest(source)
- end
-
- def eql?(other)
- other.is_a?(Inline) && other.md5_source == md5_source
- end
- end
- end
-end
- \ No newline at end of file
diff --git a/actionpack/test/controller/new_base/render_once_test.rb b/actionpack/test/controller/new_base/render_once_test.rb
index 3a847ac932..3035ed4ff2 100644
--- a/actionpack/test/controller/new_base/render_once_test.rb
+++ b/actionpack/test/controller/new_base/render_once_test.rb
@@ -79,17 +79,8 @@ module RenderTemplate
end
end
- class TestWithResolverCache < Rack::TestCase
+ class TestRenderOnce < Rack::TestCase
testing RenderTemplate::RenderOnceController
include Tests
end
-
- class TestWithoutResolverCache < Rack::TestCase
- testing RenderTemplate::RenderOnceController
- include Tests
-
- def setup
- RenderTemplate::RenderOnceController::RESOLVER.stubs(:caching?).returns(false)
- end
- end
end
diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb
index 850589b13b..6d3b26e131 100644
--- a/actionpack/test/template/lookup_context_test.rb
+++ b/actionpack/test/template/lookup_context_test.rb
@@ -180,10 +180,6 @@ class LookupContextTest < ActiveSupport::TestCase
assert_not_equal template, old_template
end
-
- test "can have cache disabled on initialization" do
- assert !ActionView::LookupContext.new(FIXTURE_LOAD_PATH, :cache => false).cache
- end
end
class LookupContextWithFalseCaching < ActiveSupport::TestCase
diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb
index f2156c31de..63f792d328 100644
--- a/actionpack/test/template/template_test.rb
+++ b/actionpack/test/template/template_test.rb
@@ -151,14 +151,6 @@ class TestERBTemplate < ActiveSupport::TestCase
end
end
- def test_inline_template_is_only_equal_if_source_match
- inline1 = ActionView::Template::Inline.new("sample", ERBHandler)
- inline2 = ActionView::Template::Inline.new("sample", ERBHandler)
- inline3 = ActionView::Template::Inline.new("other", ERBHandler)
- assert inline1.eql?(inline2)
- assert !inline1.eql?(inline3)
- end
-
if "ruby".encoding_aware?
def test_resulting_string_is_utf8
@template = new_template