Class: SeedFu::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/seed-fu/runner.rb

Overview

Runs seed files.

It is not recommended to use this class directly. Instead, use SeedFu.seed, which creates an instead of Runner and calls #run.

See Also:

Instance Method Summary collapse

Constructor Details

#initialize(fixture_paths = nil, filter = nil) ⇒ Runner



16
17
18
19
# File 'lib/seed-fu/runner.rb', line 16

def initialize(fixture_paths = nil, filter = nil)
  @fixture_paths = Array.wrap(fixture_paths || SeedFu.fixture_paths)
  @filter        = filter
end

Instance Method Details

#runObject

Run the seed files.



22
23
24
25
26
27
28
# File 'lib/seed-fu/runner.rb', line 22

def run
  puts "\n== Filtering seed files against regexp: #{@filter.inspect}" if @filter && !SeedFu.quiet

  filenames.each do |filename|
    run_file(filename)
  end
end