Class: Config::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Config::Generators::InstallGenerator
- Defined in:
- lib/generators/config/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
6 7 8 |
# File 'lib/generators/config/install_generator.rb', line 6 def self.source_root @_config_source_root ||= File.("../templates", __FILE__) end |
Instance Method Details
#copy_initializer ⇒ Object
10 11 12 |
# File 'lib/generators/config/install_generator.rb', line 10 def copy_initializer template "config.rb", "config/initializers/config.rb" end |
#copy_settings ⇒ Object
14 15 16 17 18 |
# File 'lib/generators/config/install_generator.rb', line 14 def copy_settings template "settings.yml", "config/settings.yml" template "settings.local.yml", "config/settings.local.yml" directory "settings", "config/settings" end |
#modify_gitignore ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/generators/config/install_generator.rb', line 20 def modify_gitignore create_file '.gitignore' unless File.exists? '.gitignore' append_to_file '.gitignore' do "\n" + "config/settings.local.yml\n" + "config/settings/*.local.yml\n" + "config/environments/*.local.yml\n" end end |