diff options
Diffstat (limited to 'activesupport/lib/active_support')
5 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb index 86c7703c27..1bbcaab302 100644 --- a/activesupport/lib/active_support/cache/strategy/local_cache.rb +++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb @@ -18,8 +18,8 @@ module ActiveSupport def middleware @middleware ||= begin klass = Class.new - klass.class_eval(<<-EOS, __FILE__, __LINE__) - def initialize(app) + klass.class_eval(<<-EOS, __FILE__, __LINE__ + 1) + def initialize(app @app = app end diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index c669630e47..5a7b94ead7 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -387,7 +387,7 @@ module ActiveSupport send("_update_#{symbol}_superclass_callbacks") body = send("_#{symbol}_callbacks").compile(nil) - body, line = <<-RUBY_EVAL, __LINE__ + body, line = <<-RUBY_EVAL, __LINE__ + 1 def _run_#{symbol}_callbacks(key = nil, &blk) if self.class.send("_update_#{symbol}_superclass_callbacks") self.class.__define_runner(#{symbol.inspect}) diff --git a/activesupport/lib/active_support/core_ext/module/aliasing.rb b/activesupport/lib/active_support/core_ext/module/aliasing.rb index 3cad164148..ce481f0e84 100644 --- a/activesupport/lib/active_support/core_ext/module/aliasing.rb +++ b/activesupport/lib/active_support/core_ext/module/aliasing.rb @@ -61,7 +61,7 @@ class Module # e.subject = "Megastars" # e.title # => "Megastars" def alias_attribute(new_name, old_name) - module_eval <<-STR, __FILE__, __LINE__+1 + module_eval <<-STR, __FILE__, __LINE__ + 1 def #{new_name}; self.#{old_name}; end # def subject; self.title; end def #{new_name}?; self.#{old_name}?; end # def subject?; self.title?; end def #{new_name}=(v); self.#{old_name} = v; end # def subject=(v); self.title = v; end diff --git a/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb b/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb index 4d0198f028..28ac89dab9 100644 --- a/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +++ b/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb @@ -21,7 +21,7 @@ class Module def attr_accessor_with_default(sym, default = nil, &block) raise 'Default value or block required' unless !default.nil? || block define_method(sym, block_given? ? block : Proc.new { default }) - module_eval(<<-EVAL, __FILE__, __LINE__) + module_eval(<<-EVAL, __FILE__, __LINE__ + 1) def #{sym}=(value) # def age=(value) class << self; attr_reader :#{sym} end # class << self; attr_reader :age end @#{sym} = value # @age = value diff --git a/activesupport/lib/active_support/core_ext/module/synchronization.rb b/activesupport/lib/active_support/core_ext/module/synchronization.rb index 115b8abd4e..de76a069d6 100644 --- a/activesupport/lib/active_support/core_ext/module/synchronization.rb +++ b/activesupport/lib/active_support/core_ext/module/synchronization.rb @@ -28,7 +28,7 @@ class Module raise ArgumentError, "#{method} is already synchronized. Double synchronization is not currently supported." end - module_eval(<<-EOS, __FILE__, __LINE__) + module_eval(<<-EOS, __FILE__, __LINE__ + 1) def #{aliased_method}_with_synchronization#{punctuation}(*args, &block) # def expire_with_synchronization(*args, &block) #{with}.synchronize do # @@lock.synchronize do #{aliased_method}_without_synchronization#{punctuation}(*args, &block) # expire_without_synchronization(*args, &block) |