Class: Gherkin::Tools::Reformat

Inherits:
Files
  • Object
show all
Defined in:
lib/gherkin/tools/reformat.rb

Instance Method Summary collapse

Methods inherited from Files

#each, #initialize, #scan

Constructor Details

This class inherits a constructor from Gherkin::Tools::Files

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/gherkin/tools/reformat.rb', line 8

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