Class: MoonbaseGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_configurationObject



4
5
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
# File 'lib/generators/moonbase/moonbase_generator.rb', line 4

def add_configuration
  create_file "config/moonbase_alpha.yml", <<-EOF
# This configuration is technically specified on a per-environment basis, but 
# moonbase doesn't currently use that
shared: 
# Repository for the build. A build number will be set as the version
repository: 
# These packages will be available only while installing gems and precompiling assets
build_packages: 
  - tzdata
  - postgresql-dev
  - sqlite-dev
# These pckages will be available only at runtime in the final build image
run_packages: 
  - postgresql-libs
  - tzdata
  - sqlite-libs
# If true, moonbase will run `rake assets:precompile` (not suitable for API projects)
compile_assets: false    
EOF

  environment do 
    "config.moonbase_alpha = config_for(:moonbase_alpha)"
  end

  create_file "app.rb", File.read(File.expand_path(__dir__ + "/../../../templates/app.rb"))
end