diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 6 | ||||
-rw-r--r-- | railties/lib/rails/application/dummy_erb_compiler.rb | 5 | ||||
-rw-r--r-- | railties/lib/rails/commands/credentials/USAGE | 2 | ||||
-rw-r--r-- | railties/lib/rails/commands/encrypted/USAGE | 28 | ||||
-rw-r--r-- | railties/lib/rails/commands/encrypted/encrypted_command.rb | 1 | ||||
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 1 |
6 files changed, 39 insertions, 4 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 88f9ac06f6..d2377b3b6d 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -44,7 +44,9 @@ gsub Gemfile ``` - The change command copies a template `config/database.yml` with the target database adapter into your app, and replaces your database gem with the target database gem. + The change command copies a template `config/database.yml` with + the target database adapter into your app, and replaces your database gem + with the target database gem. *Gannon McGibbon* @@ -178,7 +180,7 @@ The encryption key can be in `ENV["RAILS_MASTER_KEY"]` or `config/credentials/production.key`. Environment credentials overrides can be edited with `rails credentials:edit --environment production`. - If no override is setup for the passed environment, it will be created. + If no override is set up for the passed environment, it will be created. Additionally, the default lookup paths can be overwritten with these configs: diff --git a/railties/lib/rails/application/dummy_erb_compiler.rb b/railties/lib/rails/application/dummy_erb_compiler.rb index 4e92526969..985e6f605e 100644 --- a/railties/lib/rails/application/dummy_erb_compiler.rb +++ b/railties/lib/rails/application/dummy_erb_compiler.rb @@ -11,6 +11,9 @@ end class DummyCompiler < ERB::Compiler # :nodoc: def compile_content(stag, out) - out.push "_erbout << 'dummy_compiler'" + case stag + when '<%=' + out.push "_erbout << 'dummy_compiler'" + end end end diff --git a/railties/lib/rails/commands/credentials/USAGE b/railties/lib/rails/commands/credentials/USAGE index f7268a64d1..c8d3fb9eda 100644 --- a/railties/lib/rails/commands/credentials/USAGE +++ b/railties/lib/rails/commands/credentials/USAGE @@ -42,7 +42,7 @@ from leaking. === Environment Specific Credentials The `credentials` command supports passing an `--environment` option to create an -environment specific override. That override will takes precedence over the +environment specific override. That override will take precedence over the global `config/credentials.yml.enc` file when running in that environment. So: rails credentials:edit --environment development diff --git a/railties/lib/rails/commands/encrypted/USAGE b/railties/lib/rails/commands/encrypted/USAGE new file mode 100644 index 0000000000..253eec2378 --- /dev/null +++ b/railties/lib/rails/commands/encrypted/USAGE @@ -0,0 +1,28 @@ +=== Storing Encrypted Files in Source Control + +The Rails `encrypted` commands provide access to encrypted files or configurations. +See the `Rails.application.encrypted` documentation for using them in your app. + +=== Encryption Keys + +By default, Rails looks for the encryption key in `config/master.key` or +`ENV["RAILS_MASTER_KEY"]`, but that lookup can be overridden with `--key`: + + rails encrypted:edit config/encrypted_file.yml.enc --key config/encrypted_file.key + +Don't commit the key! Add it to your source control's ignore file. If you use +Git, Rails handles this for you. + +=== Editing Files + +To edit or create an encrypted file use: + + rails encrypted:edit config/encrypted_file.yml.enc + +This opens a temporary file in `$EDITOR` with the decrypted contents for editing. + +=== Viewing Files + +To print the decrypted contents of an encrypted file use: + + rails encrypted:show config/encrypted_file.yml.enc diff --git a/railties/lib/rails/commands/encrypted/encrypted_command.rb b/railties/lib/rails/commands/encrypted/encrypted_command.rb index 8d5947652a..f10a07cdf8 100644 --- a/railties/lib/rails/commands/encrypted/encrypted_command.rb +++ b/railties/lib/rails/commands/encrypted/encrypted_command.rb @@ -16,6 +16,7 @@ module Rails def help say "Usage:\n #{self.class.banner}" say "" + say self.class.desc end end diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 4f689bcb78..ea7117800c 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -53,6 +53,7 @@ module ApplicationTests test "db:create and db:drop respect environment setting" do app_file "config/database.yml", <<-YAML + <% 1 %> development: database: <%= Rails.application.config.database %> adapter: sqlite3 |