From a19b7d5793eb180e99fc942d5767270dccbf962c Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 15 Feb 2013 00:35:52 -0600 Subject: Make this more idiomatic --- Library/Homebrew/extend/string.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb index e9f475b6e..8c86f5dbe 100644 --- a/Library/Homebrew/extend/string.rb +++ b/Library/Homebrew/extend/string.rb @@ -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? -- cgit v1.2.3