Class: Fix2factory::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/fix2factory/converter.rb

Class Method Summary collapse

Class Method Details

.parse_all!(options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/fix2factory/converter.rb', line 9

def parse_all!(options)
  matching_options = parse_matching_options(options)
  selector = FixtureSelector.new(matching_options)
  selector.test_fixtures.each do |fixture_file_name|
    parser = FixtureParser.new(fixture_file_name)
    parser.parse_fixture
    fixture_file_name.match(/(\w+)\.yml/)
    FactoryWriter.write(parser.output_buffer, "#{Fix2factory::TEST_FACTORIES}#{$1}.rb")
  end
end

.parse_matching_options(options) ⇒ Object



20
21
22
23
# File 'lib/fix2factory/converter.rb', line 20

def parse_matching_options(options)
  return {} unless options[:matching]
  {:matching => Regexp.new(options[:matching])}
end