Add s.get_make_var

This allows more complicated transformations to happen,
such as stripping out part of the variable.
This commit is contained in:
Adam Vandenberg 2010-04-03 17:52:58 -07:00
parent e7d7ceccee
commit e1c9e24920

View File

@ -167,6 +167,12 @@ module HomebrewInreplaceExtension
gsub! Regexp.new("^#{flag}[ \\t]*=(.*)$\n?"), "" gsub! Regexp.new("^#{flag}[ \\t]*=(.*)$\n?"), ""
end end
end end
# Finds the specified variable
def get_make_var flag
m = match Regexp.new("^#{flag}[ \\t]*=[ \\t]*(.*)$")
return m[1] if m
return nil
end
end end
def inreplace path, before=nil, after=nil def inreplace path, before=nil, after=nil