Sha256: 7b506837b1cab2f82432dd4839dd51da4e4b6a27151939ece151e1dcf181dc8f

Contents?: true

Size: 411 Bytes

Versions: 10

Compression:

Stored size: 411 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)
          File.open(file, 'w') {|io| io.write(purdy.string)}
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gherkin-2.0.1 lib/gherkin/tools/reformat.rb
gherkin-2.0.1-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-2.0.1-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-2.0.1-universal-dotnet lib/gherkin/tools/reformat.rb
gherkin-2.0.1-java lib/gherkin/tools/reformat.rb
gherkin-2.0.0 lib/gherkin/tools/reformat.rb
gherkin-2.0.0-i386-mswin32 lib/gherkin/tools/reformat.rb
gherkin-2.0.0-i386-mingw32 lib/gherkin/tools/reformat.rb
gherkin-2.0.0-universal-dotnet lib/gherkin/tools/reformat.rb
gherkin-2.0.0-java lib/gherkin/tools/reformat.rb