Move Environment#command_to_s to Util.
This commit is contained in:
parent
3f8b4d616f
commit
db788cdd35
@ -644,7 +644,7 @@ module Rscons
|
||||
case @echo
|
||||
when :command
|
||||
if command.is_a?(Array)
|
||||
message = command_to_s(command)
|
||||
message = Util.command_to_s(command)
|
||||
elsif command.is_a?(String)
|
||||
message = command
|
||||
elsif short_description.is_a?(String)
|
||||
@ -663,7 +663,7 @@ module Rscons
|
||||
#
|
||||
# @return [void]
|
||||
def print_failed_command(command)
|
||||
Ansi.write($stdout, :red, "Failed command was: #{command_to_s(command)}", :reset, "\n")
|
||||
Ansi.write($stdout, :red, "Failed command was: #{Util.command_to_s(command)}", :reset, "\n")
|
||||
end
|
||||
|
||||
private
|
||||
@ -752,17 +752,6 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
# Return a string representation of a command.
|
||||
#
|
||||
# @param command [Array<String>]
|
||||
# The command.
|
||||
#
|
||||
# @return [String]
|
||||
# The string representation of the command.
|
||||
def command_to_s(command)
|
||||
command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
|
||||
end
|
||||
|
||||
# Call a builder's #finalize method after a ThreadedCommand terminates.
|
||||
#
|
||||
# @param tc [ThreadedCommand]
|
||||
|
@ -15,6 +15,17 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
# Return a string representation of a command.
|
||||
#
|
||||
# @param command [Array<String>]
|
||||
# The command.
|
||||
#
|
||||
# @return [String]
|
||||
# The string representation of the command.
|
||||
def command_to_s(command)
|
||||
command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
|
||||
end
|
||||
|
||||
# Make a relative path corresponding to a possibly absolute one.
|
||||
#
|
||||
# @param path [String]
|
||||
|
Loading…
x
Reference in New Issue
Block a user