Class: Planter::Generators::InitializerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/planter/initializer_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/generators/planter/initializer_generator.rb', line 6

def create_initializer_file
  create_file "config/initializers/planter.rb", <<~EOF
    require 'planter'

    Planter.configure do |config|
      ##
      # The list of seeders. These files are stored in the
      # config.seeders_directory, which can be changed below. When a new
      # seeder is generated, it will be appended to the bottom of this
      # list. If the order is incorrect, you'll need to adjust it.
      # Just be sure to keep the ending bracket on its own line, or the
      # generator won't know where to put new elements.
      config.seeders = %i[
      ]

      ##
      # The directory where the seeders are kept.
      # config.seeders_directory = 'db/seeds'

      ##
      # The directory where CSVs are kept.
      # config.csv_files_directory = 'db/seed_files'

      ##
      # The default trim mode for ERB. Valid modes are:
      # '%'  enables Ruby code processing for lines beginning with %
      # '<>' omit newline for lines starting with <% and ending in %>
      # '>'  omit newline for lines ending in %>
      # '-'  omit blank lines ending in -%>
      # I recommend reading the help documentation for ERB::new()
      # config.erb_trim_mode = nil
    end
  EOF
end