Make this more idiomatic
This commit is contained in:
parent
2ef79d1387
commit
9fd5953ed9
@ -55,9 +55,7 @@ module StringInreplaceExtension
|
||||
|
||||
# Removes variable assignments completely.
|
||||
def remove_make_var! flags
|
||||
# Next line is for Ruby 1.9.x compatibility
|
||||
flags = [flags] unless flags.kind_of? Array
|
||||
flags.each do |flag|
|
||||
Array(flags).each do |flag|
|
||||
# Also remove trailing \n, if present.
|
||||
sub = gsub! Regexp.new("^#{flag}[ \\t]*=(.*)$\n?"), "", false
|
||||
opoo "inreplace: removing '#{flag}' failed" if sub.nil?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user