Class: PhilColumns::Seeder
- Inherits:
-
Object
- Object
- PhilColumns::Seeder
- Defined in:
- lib/phil_columns/seeder.rb
Constant Summary
Constants included from SeedUtils
PhilColumns::SeedUtils::SEED_REGEX
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(config) ⇒ Seeder
constructor
A new instance of Seeder.
Methods included from SeedUtils
#archivist, #discover_seed_class, #discover_seed_timestamp, #each_seed_meta_for_current_env, #load_seeds, #map_seeds, #seed_already_executed?, #seed_filepaths, #seeds_for_current_env, #seeds_path
Methods included from Output
#confirm, included, #say, #say_error, #say_ok, #say_skipping, #write
Constructor Details
#initialize(config) ⇒ Seeder
Returns a new instance of Seeder.
7 8 9 |
# File 'lib/phil_columns/seeder.rb', line 7 def initialize( config ) @config = config end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/phil_columns/seeder.rb', line 11 def execute seeds.each do || confirm "Executing seed: #{.name} ... ", :cyan do unless dependencies_satisfied?( .klass.depends_on ) raise PhilColumns::Error, ( ) end instance = .klass.new( config ) instance.send( method_name ) record_seed( ) end end end |