Class: ActiveConfigRails::Generators::ForceUpgradeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/active_config_rails.rb

Instance Method Summary collapse

Instance Method Details

#convert_database_yamlObject



16
17
18
19
20
21
22
23
24
# File 'lib/active_config_rails.rb', line 16

def convert_database_yaml
  copy_file 'database.yml', 'config/database.yml'
  copy_file 'rails.yml', 'etc/rails.yml'


  #comment = "\n  # Set the logging destination(s)\n  %s\n"
  #insert_into_file 'config/environments/development.rb', comment % 'config.log_to = %w[stdout file]', :before => %r/^end\s*$/
  #insert_into_file 'config/environments/production.rb', comment % 'config.log_to = %w[file]', :before => %r/^end\s*$/
end

#generate_configObject



8
9
10
# File 'lib/active_config_rails.rb', line 8

def generate_config
  template 'active_config_initializer.rb', 'config/initializers/active_config.rb'
end

#insert_to_applicationObject



12
13
14
15
# File 'lib/active_config_rails.rb', line 12

def insert_to_application
  ln = "require File.expand_path('../initializers/active_config', __FILE__)\n"
  append_to_file 'config/boot.rb', ln
end