build_config/helpers/wine_runner.rb
def clean(output, stderr = false)
  ends_with_newline = !!(output =~ /\n$/)
  executable = ARGV[0].gsub(/\.exe\z/i, '')

  # Fix line-ends
  output = output.gsub(/\r\n/, "\n")

  # Strip out Wine messages


  results = output.split(/\n/).map do |line|
    # Fix file paths
    if line =~ /#{DOSROOT}\\/i
      line.gsub!(/#{DOSROOT}([^:]*)/i) { |path|
        path.gsub!(/^#{DOSROOT}/i, '')
        path.gsub!(%r{\\}, '/')
        path
      }
    end

    # strip '.exe' off the end of the executable's name if needed
    line.gsub!(/(#{Regexp.escape executable})\.exe/i, '\1')

    line
  end

  result_text = results.join("\n")
  result_text += "\n" if ends_with_newline
  return result_text
end
# Rewrite test output to replace DOS-isms with Unix-isms.
Rewrite test output to replace DOS-isms with Unix-isms.
Rewrite test output to replace DOS - isms with Unix - isms .
def clean(output, stderr = false)
  ends_with_newline = !!(output =~ /\n$/)
  executable = ARGV[0].gsub(/\.exe\z/i, '')
  output = output.gsub(/\r\n/, "\n")
  results = output.split(/\n/).map do |line|
    if line =~ /#{DOSROOT}\\/i
      line.gsub!(/#{DOSROOT}([^:]*)/i) { |path|
        path.gsub!(/^#{DOSROOT}/i, '')
        path.gsub!(%r{\\}, '/')
        path
      }
    end
    line.gsub!(/(#{Regexp.escape executable})\.exe/i, '\1')
    line
  end
  result_text = results.join("\n")
  result_text += "\n" if ends_with_newline
  return result_text
end
def clean ( output , stderr = false ) ends_with_newline = ! ! ( output =~ / \n $ / ) executable = ARGV [ 0 ] . gsub ( / \. exe \z /i , '' ) output = output . gsub ( / \r \n / , "\n" ) results = output . split ( / \n / ) . map do | line | if line =~ / #{ DOSROOT } \\ /i line . gsub! ( / #{ DOSROOT } ([^:]*) /i ) { | path | path . gsub! ( / ^ #{ DOSROOT } /i , '' ) path . gsub! ( %r{ \\ } , '/' ) path } end line . gsub! ( / ( #{ Regexp . escape executable } ) \. exe /i , '\1' ) line end result_text = results . join ( "\n" ) result_text += "\n" if ends_with_newline return result_text end
Rewrite test output to replace DOS-isms with Unix-isms.
Rewrite test output to replace DOS - isms with Unix - isms .
# Fix line-ends # Strip out Wine messages # Fix file paths # strip '.exe' off the end of the executable's name if needed
output
stderr