diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-12-12 14:58:53 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-12-12 17:05:52 -0500 |
commit | bb7537bc872e0a724fa97468e5899de0c70c1fc1 (patch) | |
tree | 3d6c08175b1835c317f5e83a26b368eae178873c /railties | |
parent | 39fd0be7660e2f666328af85c705c3df5a8ac09e (diff) | |
download | rails-bb7537bc872e0a724fa97468e5899de0c70c1fc1.tar.gz rails-bb7537bc872e0a724fa97468e5899de0c70c1fc1.tar.bz2 rails-bb7537bc872e0a724fa97468e5899de0c70c1fc1.zip |
Rename tokens.yml to secrets.yml
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/secrets.yml (renamed from railties/lib/rails/generators/rails/app/templates/config/tokens.yml) | 0 | ||||
-rw-r--r-- | railties/test/application/configuration_test.rb | 6 |
5 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 20e90737b0..06acb4c877 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -304,7 +304,7 @@ module Rails def secrets #:nodoc: @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new - yaml = config.paths["config/tokens"].first + yaml = config.paths["config/secrets"].first if File.exist?(yaml) require "erb" env_secrets = YAML.load(ERB.new(IO.read(yaml)).result)[Rails.env] diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index f835ccceaa..9975bb8596 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -76,7 +76,7 @@ module Rails @paths ||= begin paths = super paths.add "config/database", with: "config/database.yml" - paths.add "config/tokens", with: "config/tokens.yml" + paths.add "config/secrets", with: "config/secrets.yml" paths.add "config/environment", with: "config/environment.rb" paths.add "lib/templates" paths.add "log", with: "log/#{Rails.env}.log" diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 2c4911cadc..e12ee3c713 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -78,7 +78,7 @@ module Rails template "routes.rb" template "application.rb" template "environment.rb" - template "tokens.yml" + template "secrets.yml" directory "environments" directory "initializers" diff --git a/railties/lib/rails/generators/rails/app/templates/config/tokens.yml b/railties/lib/rails/generators/rails/app/templates/config/secrets.yml index 3ce5de1dc9..3ce5de1dc9 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/tokens.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/secrets.yml diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 6554e0e08a..e024ec8cef 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -304,7 +304,7 @@ module ApplicationTests end test "secrets.secret_key_base is used when config/tokens.yml is present" do - app_file 'config/tokens.yml', <<-YAML + app_file 'config/secrets.yml', <<-YAML development: secret_key_base: 3b7cd727ee24e8444053437c36cc66c3 YAML @@ -314,7 +314,7 @@ module ApplicationTests end test "secret_key_base is copied from config to secrets when not set" do - remove_file "config/tokens.yml" + remove_file "config/secrets.yml" app_file 'config/initializers/secret_token.rb', <<-RUBY Rails.application.config.secret_key_base = "3b7cd727ee24e8444053437c36cc66c3" RUBY @@ -324,7 +324,7 @@ module ApplicationTests end test "custom secrets saved in config/tokens.yml are loaded in app secrets" do - app_file 'config/tokens.yml', <<-YAML + app_file 'config/secrets.yml', <<-YAML development: secret_key_base: 3b7cd727ee24e8444053437c36cc66c3 aws_access_key_id: myamazonaccesskeyid |