Class: ActiveConfigRails::Generators::ForceUpgradeGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActiveConfigRails::Generators::ForceUpgradeGenerator
- Defined in:
- lib/active_config_rails.rb
Instance Method Summary collapse
Instance Method Details
#convert_database_yaml ⇒ Object
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_config ⇒ Object
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_application ⇒ Object
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 |