Sha256: 307e7bd4ea2dd3c309ca6962bdef71cfd2f4783a26ae7fc9851729abff34e30c

Contents?: true

Size: 414 Bytes

Versions: 28

Compression:

Stored size: 414 Bytes

Contents

require 'stringio'
require 'gherkin/tools/files'
require 'gherkin/tools/pretty_listener'

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
gherkin-1.0.8 lib/gherkin/tools/reformat.rb
gherkin-1.0.8-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.8-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.8-java lib/gherkin/tools/reformat.rb
gherkin-1.0.7 lib/gherkin/tools/reformat.rb
gherkin-1.0.7-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.7-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.7-java lib/gherkin/tools/reformat.rb
gherkin-1.0.6 lib/gherkin/tools/reformat.rb
gherkin-1.0.6-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.6-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.6-java lib/gherkin/tools/reformat.rb
gherkin-1.0.5-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.5-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.5-java lib/gherkin/tools/reformat.rb
gherkin-1.0.5 lib/gherkin/tools/reformat.rb
gherkin-1.0.4-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-1.0.4-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-1.0.4-java lib/gherkin/tools/reformat.rb
gherkin-1.0.4 lib/gherkin/tools/reformat.rb