Sha256: 6a94fc3fc06459d402333c9c81dfd201ab54d562f3b1f477bdf515b6132e47f5
Contents?: true
Size: 653 Bytes
Versions: 35
Compression:
Stored size: 653 Bytes
Contents
require 'stringio' require 'gherkin/tools/files' require 'gherkin/formatter/pretty_formatter' require 'gherkin/listener/formatter_listener' module Gherkin module Tools class Reformat < Files def run each do |file| io = defined?(JRUBY_VERSION) ? Java.java.io.StringWriter.new : StringIO.new formatter = Formatter::PrettyFormatter.new(io, true) listener = Listener::FormatterListener.new(formatter) scan(file, listener) string = defined?(JRUBY_VERSION) ? io.getBuffer.toString : io.string File.open(file, 'w') {|io| io.write(string)} end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems