aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/module.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/module.rb b/Library/Homebrew/extend/module.rb
index 9210793f6..045508fd1 100644
--- a/Library/Homebrew/extend/module.rb
+++ b/Library/Homebrew/extend/module.rb
@@ -1,7 +1,10 @@
class Module
def attr_rw(*attrs)
+ file, line, _ = caller.first.split(":")
+ line = line.to_i
+
attrs.each do |attr|
- module_eval <<-EOS, __FILE__, __LINE__ + 1
+ module_eval <<-EOS, file, line
def #{attr}(val=nil)
val.nil? ? @#{attr} : @#{attr} = val
end