Class: FixToChix::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/fix_to_chix/controller.rb

Class Method Summary collapse

Class Method Details

.parse_it_all!(options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fix_to_chix/controller.rb', line 10

def parse_it_all!(options)
  matching_options = parse_matching_options(options)
  selector = FixtureSelector.new(matching_options)
  %w[spec test].each do |type| 
    selector.send("#{type}_fixtures").each do |fixture_file_name|
      parser = FixtureParser.new(fixture_file_name)
      parser.parse_fixture
      FactoryWriter.write(parser.output_buffer, FixToChix.class_eval("#{type.upcase}_TARGET_FILE"))
    end
  end
end

.parse_matching_options(options) ⇒ Object



22
23
24
25
# File 'lib/fix_to_chix/controller.rb', line 22

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