diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index 9185045adfaac5bdff4df060a013f9fd1146c771..f66356c939269cde5e5f28b64c0b97c2cf5bcfcf 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -12,12 +12,12 @@ def self.included(base) def handler Template.handler_class_for_extension(extension) end - memorize :handler + memoize :handler def compiled_source handler.new(nil).compile(self) if handler.compilable? end - memorize :compiled_source + memoize :compiled_source def render(view, local_assigns = {}) view._first_render ||= self diff --git a/actionpack/lib/action_view/renderable_partial.rb b/actionpack/lib/action_view/renderable_partial.rb index d2fe635b9c4e0200769fe9369d5f2dce2fd2fbe6..fdb1a5e6a7aed9560850459a869aabc3c65bda39 100644 --- a/actionpack/lib/action_view/renderable_partial.rb +++ b/actionpack/lib/action_view/renderable_partial.rb @@ -8,12 +8,12 @@ module RenderablePartial def variable_name name.sub(/\A_/, '').to_sym end - memorize :variable_name + memoize :variable_name def counter_name "#{variable_name}_counter".to_sym end - memorize :counter_name + memoize :counter_name def render(view, local_assigns = {}) ActionController::Base.benchmark("Rendered #{path_without_format_and_extension}", Logger::DEBUG, false) do diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index b39ba0c48b79d1693adec3f9cd44804d7957e181..304aec3a4c54cbc23027acb2f9a4c28ee2860998 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -20,34 +20,34 @@ def initialize(template_path, load_paths = []) def format_and_extension (extensions = [format, extension].compact.join(".")).blank? ? nil : extensions end - memorize :format_and_extension + memoize :format_and_extension def path [base_path, [name, format, extension].compact.join('.')].compact.join('/') end - memorize :path + memoize :path def path_without_extension [base_path, [name, format].compact.join('.')].compact.join('/') end - memorize :path_without_extension + memoize :path_without_extension def path_without_format_and_extension [base_path, name].compact.join('/') end - memorize :path_without_format_and_extension + memoize :path_without_format_and_extension def source File.read(filename) end - memorize :source + memoize :source def method_segment segment = File.expand_path(filename) segment.sub!(/^#{Regexp.escape(File.expand_path(RAILS_ROOT))}/, '') if defined?(RAILS_ROOT) segment.gsub!(/([^a-zA-Z0-9_])/) { $1.ord } end - memorize :method_segment + memoize :method_segment def render_template(view, local_assigns = {}) render(view, local_assigns) diff --git a/activesupport/lib/active_support/memoizable.rb b/activesupport/lib/active_support/memoizable.rb index c78fb0a793f8db2511ca488f94ed2aabe698eb5d..65feca363a12f7ac11af4a6ce94cc00380b856bb 100644 --- a/activesupport/lib/active_support/memoizable.rb +++ b/activesupport/lib/active_support/memoizable.rb @@ -5,8 +5,8 @@ def self.included(base) #:nodoc: end module ClassMethods - def memorize(symbol) - original_method = "_unmemorized_#{symbol}" + def memoize(symbol) + original_method = "_unmemoized_#{symbol}" alias_method original_method, symbol class_eval <<-EOS, __FILE__, __LINE__ def #{symbol} @@ -22,7 +22,7 @@ def #{symbol} def freeze methods.each do |method| - if m = method.to_s.match(/^_unmemorized_(.*)/) + if m = method.to_s.match(/^_unmemoized_(.*)/) send(m[1]).freeze end end diff --git a/activesupport/test/memoizable_test.rb b/activesupport/test/memoizable_test.rb index 40a02cf2532058317828f978aacca32d3a5ffc08..1b6cec2b2f535bbb2450d6b9b9c63ff41ed1dc29 100644 --- a/activesupport/test/memoizable_test.rb +++ b/activesupport/test/memoizable_test.rb @@ -8,12 +8,12 @@ class Person def name fetch_name_from_floppy end - memorize :name + memoize :name def age nil end - memorize :age + memoize :age private def fetch_name_from_floppy