Sha256: 5dfd24552703a15a30327ead7b84db29f19a50b251b23dd5ed214f188f5467f7

Contents?: true

Size: 438 Bytes

Versions: 89

Compression:

Stored size: 438 Bytes

Contents

if defined?(JRUBY_VERSION)
  class OutputStreamStringIO < Java.java.io.ByteArrayOutputStream
    def write(what)
      if String === what
        super(Java.java.lang.String.new(what).getBytes("UTF-8"))
      else
        super(what)
      end
    end

    def string
      toString("UTF-8")
    end
  end

  require 'stringio'
  class StringIO
    class << self
      def new
        OutputStreamStringIO.new
      end
    end
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
gherkin-2.2.8 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.8-x86-mswin32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.8-x86-mingw32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.8-universal-dotnet spec/gherkin/output_stream_string_io.rb
gherkin-2.2.8-java spec/gherkin/output_stream_string_io.rb
gherkin-2.2.7 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.7-x86-mswin32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.7-x86-mingw32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.7-universal-dotnet spec/gherkin/output_stream_string_io.rb
gherkin-2.2.7-java spec/gherkin/output_stream_string_io.rb
gherkin-2.2.6 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.6-x86-mswin32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.6-x86-mingw32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.6-universal-dotnet spec/gherkin/output_stream_string_io.rb
gherkin-2.2.6-java spec/gherkin/output_stream_string_io.rb
gherkin-2.2.5 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.5-x86-mswin32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.5-x86-mingw32 spec/gherkin/output_stream_string_io.rb
gherkin-2.2.5-universal-dotnet spec/gherkin/output_stream_string_io.rb
gherkin-2.2.5-java spec/gherkin/output_stream_string_io.rb