module Cucumber::WindowsOutput

@private

Public Class Methods

extended(output) click to toggle source
# File lib/cucumber/formatter/unicode.rb, line 25
def self.extended(output)
  output.instance_eval do
    def cucumber_preprocess_output(*out)
      out.map { |arg| arg.to_s.encode(Encoding.default_external) }
    rescue Encoding::UndefinedConversionError => e
      STDERR.cucumber_puts("WARNING: #{e.message}")
      out
    end

    alias cucumber_print print
    def print(*out)
      cucumber_print(*cucumber_preprocess_output(*out))
    end

    alias cucumber_puts puts
    def puts(*out)
      cucumber_puts(*cucumber_preprocess_output(*out))
    end
  end
end

Public Instance Methods

cucumber_preprocess_output(*out) click to toggle source
# File lib/cucumber/formatter/unicode.rb, line 27
def cucumber_preprocess_output(*out)
  out.map { |arg| arg.to_s.encode(Encoding.default_external) }
rescue Encoding::UndefinedConversionError => e
  STDERR.cucumber_puts("WARNING: #{e.message}")
  out
end
print(*out) click to toggle source
puts(*out) click to toggle source
# File lib/cucumber/formatter/unicode.rb, line 40
def puts(*out)
  cucumber_puts(*cucumber_preprocess_output(*out))
end