Class: Confset::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Confset::Generators::InstallGenerator
- Defined in:
- lib/generators/confset/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/generators/confset/install_generator.rb', line 8 def self.source_root @_config_source_root ||= File.("../templates", __FILE__) end |
Instance Method Details
#copy_initializer ⇒ Object
12 13 14 |
# File 'lib/generators/confset/install_generator.rb', line 12 def copy_initializer template "confset.rb", "config/initializers/confset.rb" end |
#copy_settings ⇒ Object
16 17 18 19 20 |
# File 'lib/generators/confset/install_generator.rb', line 16 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
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/generators/confset/install_generator.rb', line 22 def modify_gitignore create_file ".gitignore" unless File.exist? ".gitignore" append_to_file ".gitignore" do "\n" + "config/settings.local.yml\n" + "config/settings/*.local.yml\n" + "config/environments/*.local.yml\n" end end |