Sha256: 632c4ba3bc7edf766447c7fe525c5e4b56d77af37fb1f8d7a9ddbb66af7fa2e3

Contents?: true

Size: 432 Bytes

Versions: 41

Compression:

Stored size: 432 Bytes

Contents

require 'stringio'
require 'gherkin/tools/files'
require 'gherkin/formatter/pretty_formatter'

module Gherkin
  module Tools
    class Reformat < Files
      def run
        each do |file|
          purdy = StringIO.new
          listener = Formatter::PrettyFormatter.new(purdy)
          scan(file, listener)
          purdy.rewind
          File.open(file, 'w') {|io| io.write(purdy.read)}
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
gherkin-1.0.30 lib/gherkin/tools/reformat.rb
gherkin-1.0.30-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.30-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.30-universal-dotnet lib/gherkin/tools/reformat.rb
gherkin-1.0.30-java lib/gherkin/tools/reformat.rb
gherkin-1.0.29 lib/gherkin/tools/reformat.rb
gherkin-1.0.29-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.29-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.29-java lib/gherkin/tools/reformat.rb
gherkin-1.0.28 lib/gherkin/tools/reformat.rb
gherkin-1.0.28-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.28-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.28-java lib/gherkin/tools/reformat.rb
gherkin-1.0.27 lib/gherkin/tools/reformat.rb
gherkin-1.0.27-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.27-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.27-java lib/gherkin/tools/reformat.rb
gherkin-1.0.26 lib/gherkin/tools/reformat.rb
gherkin-1.0.26-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.26-i386-mingw32 lib/gherkin/tools/reformat.rb