module Cucumber::WindowsOutput

@private

Public Class Methods

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

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

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

Public Instance Methods

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