Sha256: 5db24ed64818e78c7772a09526f235074af658fbe50d2c31dc547a7f80702472

Contents?: true

Size: 420 Bytes

Versions: 44

Compression:

Stored size: 420 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 = 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

44 entries across 44 versions & 1 rubygems

Version Path
gherkin-1.0.19 lib/gherkin/tools/reformat.rb
gherkin-1.0.19-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.19-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.19-java lib/gherkin/tools/reformat.rb
gherkin-1.0.18 lib/gherkin/tools/reformat.rb
gherkin-1.0.18-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.18-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.18-java lib/gherkin/tools/reformat.rb
gherkin-1.0.17 lib/gherkin/tools/reformat.rb
gherkin-1.0.17-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.17-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.17-java lib/gherkin/tools/reformat.rb
gherkin-1.0.16 lib/gherkin/tools/reformat.rb
gherkin-1.0.16-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.16-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.16-java lib/gherkin/tools/reformat.rb
gherkin-1.0.15 lib/gherkin/tools/reformat.rb
gherkin-1.0.15-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.15-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.15-java lib/gherkin/tools/reformat.rb