aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-04-09 15:56:50 -0300
committerJosé Valim <jose.valim@gmail.com>2010-04-09 21:28:49 +0200
commit13e00ce6064fd1ce143071e3531e65f64047b013 (patch)
tree926d6d212b926d84432a71cb73814fe437d42655 /activesupport/lib/active_support/core_ext
parent8b2266a8dada979d72ff6eda4349a24be3b630eb (diff)
downloadrails-13e00ce6064fd1ce143071e3531e65f64047b013.tar.gz
rails-13e00ce6064fd1ce143071e3531e65f64047b013.tar.bz2
rails-13e00ce6064fd1ce143071e3531e65f64047b013.zip
fix stack trace lines on class_eval
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/module/aliasing.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/module/synchronization.rb2
3 files changed, 3 insertions, 3 deletions
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)