Class: Planter::Config
- Inherits:
-
Object
- Object
- Planter::Config
- Defined in:
- lib/planter/config.rb
Overview
Configure the application seeder.
Instance Attribute Summary collapse
-
#csv_files_directory ⇒ String
Tell the application where the CSV seed files are kept.
-
#erb_trim_mode ⇒ String
The default trim mode for ERB.
-
#quiet ⇒ Boolean
When true, don’t print output when seeding.
-
#seeders ⇒ Array
Tell the application what seeders exist.
-
#seeders_directory ⇒ String
Tell the application where the seeder classes are kept.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Create a new instance of the config.
Constructor Details
#initialize ⇒ Config
Create a new instance of the config.
56 57 58 59 60 |
# File 'lib/planter/config.rb', line 56 def initialize @quiet = false @seeders_directory = ::File.join('db', 'seeds') @csv_files_directory = ::File.join('db', 'seed_files') end |
Instance Attribute Details
#csv_files_directory ⇒ String
Tell the application where the CSV seed files are kept. Must be a path relative to Rails.root.
26 27 28 |
# File 'lib/planter/config.rb', line 26 def csv_files_directory @csv_files_directory end |
#erb_trim_mode ⇒ String
The default trim mode for ERB. Must be “%”, “<>”, “>”, or “-”. For more information, see documentation for ERB::new.
52 53 54 |
# File 'lib/planter/config.rb', line 52 def erb_trim_mode @erb_trim_mode end |
#quiet ⇒ Boolean
When true, don’t print output when seeding.
43 44 45 |
# File 'lib/planter/config.rb', line 43 def quiet @quiet end |
#seeders ⇒ Array
Tell the application what seeders exist. Elements should be in the correct order to seed the tables successfully, and can be strings or symbols.
35 36 37 |
# File 'lib/planter/config.rb', line 35 def seeders @seeders end |
#seeders_directory ⇒ String
Tell the application where the seeder classes are kept. Must be a path relative to Rails.root.
17 18 19 |
# File 'lib/planter/config.rb', line 17 def seeders_directory @seeders_directory end |