Mike McQuaid 9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00

17 lines
320 B
Ruby

class Module
def attr_rw(*attrs)
file, line, = caller.first.split(":")
line = line.to_i
attrs.each do |attr|
module_eval <<-EOS, file, line
def #{attr}(val=nil)
@#{attr} ||= nil
return @#{attr} if val.nil?
@#{attr} = val
end
EOS
end
end
end