Class: Rails::Generators::CredentialsGenerator

Inherits:
Base
  • Object
show all
Defined in:
railties/lib/rails/generators/rails/credentials/credentials_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Base

base_root, class_option, default_source_root, desc, exit_on_failure?, hide!, hook_for, inherited, namespace, remove_hook_for, source_root

Methods included from Actions

#add_source, #environment, #gem, #gem_group, #generate, #git, #github, #initialize, #initializer, #lib, #rails_command, #rake, #rakefile, #readme, #route, #vendor

Instance Method Details

#add_credentials_fileObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'railties/lib/rails/generators/rails/credentials/credentials_generator.rb', line 14

def add_credentials_file
  in_root do
    return if File.exist?(content_path)

    say "Adding #{content_path} to store encrypted credentials."
    say ""

    content = render_template_to_encrypted_file

    say "The following content has been encrypted with the Rails master key:"
    say ""
    say content, :on_green
    say ""
    say "You can edit encrypted credentials with `bin/rails credentials:edit`."
    say ""
  end
end