Class: SecretsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SecretsGenerator
- Defined in:
- lib/generators/secrets_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_example_file ⇒ Object
8 9 10 |
# File 'lib/generators/secrets_generator.rb', line 8 def copy_example_file copy_file('secrets.yml.example', "#{Rails.root}/config/secrets.yml.example") end |
#create_secrets_file ⇒ Object
4 5 6 |
# File 'lib/generators/secrets_generator.rb', line 4 def create_secrets_file create_file("#{Rails.root}/config/secrets.yml") end |
#gitignore_secrets_file ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/generators/secrets_generator.rb', line 12 def gitignore_secrets_file append_to_file("#{Rails.root}/.gitignore") do "\n\n" + "# Sensitive API and password information.\n" + "# Keep it secret. Keep it safe.\n" + "config/secrets.yml" end end |