diff options
| author | Jack Nagel | 2013-12-12 14:16:43 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-12 14:20:46 -0600 |
| commit | 00d0de5b240571118e41360a615776a172094f2f (patch) | |
| tree | 6b8b7c2790ddebed6c38dd44328eee16611e8b1b /Library | |
| parent | c0d199759fd73014c8fc36f6116a8d36a2a95a81 (diff) | |
| download | brew-00d0de5b240571118e41360a615776a172094f2f.tar.bz2 | |
Report correct file/line in backtraces for attr_rw methods
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/module.rb | 5 |
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 |
