[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 коммит произвёл git
Родитель ba3dfe6efe
Коммит 0d3898ec7b
1 изменённых файлов: 4 добавлений и 10 удалений

Просмотреть файл

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