[rubygems/rubygems] Remove more unused stuff from make command parsing

https://github.com/rubygems/rubygems/commit/eba7d173d4
This commit is contained in:
David Rodríguez 2021-11-09 11:52:44 +01:00 committed by git
parent ba3dfe6efe
commit 0d3898ec7b

View File

@ -245,16 +245,14 @@ class Gem::TestCase < Test::Unit::TestCase
output.scan(/^#{Regexp.escape make_command}(?:[[:blank:]].*)?$/) output.scan(/^#{Regexp.escape make_command}(?:[[:blank:]].*)?$/)
end end
def parse_make_command_line(line) def parse_make_command_line_targets(line)
args = line.sub(/^#{Regexp.escape make_command}/, "").shellsplit args = line.sub(/^#{Regexp.escape make_command}/, "").shellsplit
targets = [] targets = []
macros = {}
args.each do |arg| args.each do |arg|
case arg case arg
when /\A(\w+)=/ when /\A(\w+)=/
macros[$1] = $'
else else
targets << arg targets << arg
end end
@ -262,11 +260,7 @@ class Gem::TestCase < Test::Unit::TestCase
targets << '' if targets.empty? targets << '' if targets.empty?
{ targets
:command => make_command,
:targets => targets,
:macros => macros,
}
end end
def assert_contains_make_command(target, output, msg = nil) def assert_contains_make_command(target, output, msg = nil)
@ -287,9 +281,9 @@ class Gem::TestCase < Test::Unit::TestCase
end end
assert scan_make_command_lines(output).any? {|line| assert scan_make_command_lines(output).any? {|line|
make = parse_make_command_line(line) targets = parse_make_command_line_targets(line)
if make[:targets].include?(target) if targets.include?(target)
true true
else else
false false