diff options
author | Wojciech Wnętrzak <w.wnetrzak@gmail.com> | 2017-11-29 10:38:51 +0100 |
---|---|---|
committer | Wojciech Wnętrzak <w.wnetrzak@gmail.com> | 2018-02-02 10:33:19 +0100 |
commit | c8dc4f2e41afa07c2b2ec701e2ba4682e5ccdd37 (patch) | |
tree | 80a1c4e5a474c94a0c833668c8fd0bcf7c61f2fa /railties | |
parent | 74aa62cb691f1abd12e244c3498dc696e0b7ef77 (diff) | |
download | rails-c8dc4f2e41afa07c2b2ec701e2ba4682e5ccdd37.tar.gz rails-c8dc4f2e41afa07c2b2ec701e2ba4682e5ccdd37.tar.bz2 rails-c8dc4f2e41afa07c2b2ec701e2ba4682e5ccdd37.zip |
Removed "private" generators from command list.
Appropriate way to handle encrypted command is by `bin/rails credentials` and
`bin/rails encrypted`
It was displayed on `bin/rails generate` command:
```
Please choose a generator below.
Rails:
application_record
assets
channel
controller
encrypted_file
encryption_key_file
generator
...
```
Diffstat (limited to 'railties')
3 files changed, 5 insertions, 18 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 6c9c109f17..6a7175c02b 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -218,6 +218,9 @@ module Rails rails.delete("app") rails.delete("plugin") rails.delete("encrypted_secrets") + rails.delete("encrypted_file") + rails.delete("encryption_key_file") + rails.delete("master_key") rails.delete("credentials") hidden_namespaces.each { |n| groups.delete(n.to_s) } diff --git a/railties/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb b/railties/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb index 4ce2fc1d86..85b3663fba 100644 --- a/railties/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb +++ b/railties/lib/rails/generators/rails/encrypted_file/encrypted_file_generator.rb @@ -5,23 +5,7 @@ require "active_support/encrypted_file" module Rails module Generators - class EncryptedFileGenerator < Base - def add_encrypted_file(file_path, key_path) - unless File.exist?(file_path) - say "Adding #{file_path} to store encrypted content." - say "" - say "The following content has been encrypted with the encryption key:" - say "" - say template, :on_green - say "" - - add_encrypted_file_silently(file_path, key_path) - - say "You can edit encrypted file with `bin/rails encrypted:edit #{file_path}`." - say "" - end - end - + class EncryptedFileGenerator < Base # :nodoc: def add_encrypted_file_silently(file_path, key_path, template = encrypted_file_template) unless File.exist?(file_path) setup = { content_path: file_path, key_path: key_path, env_key: "RAILS_MASTER_KEY", raise_if_missing_key: true } diff --git a/railties/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb b/railties/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb index a396a9661f..90068c678d 100644 --- a/railties/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb +++ b/railties/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb @@ -6,7 +6,7 @@ require "active_support/encrypted_file" module Rails module Generators - class EncryptionKeyFileGenerator < Base + class EncryptionKeyFileGenerator < Base # :nodoc: def add_key_file(key_path) key_path = Pathname.new(key_path) |