Skip to content
Browse files

Rename tokens.yml to secrets.yml

  • Loading branch information...
1 parent 39fd0be commit bb7537bc872e0a724fa97468e5899de0c70c1fc1 @guilleiguaran guilleiguaran committed Dec 12, 2013
View
2 railties/lib/rails/application.rb
@@ -304,7 +304,7 @@ def config=(configuration) #:nodoc:
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]
View
2 railties/lib/rails/application/configuration.rb
@@ -76,7 +76,7 @@ def paths
@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"
View
2 railties/lib/rails/generators/rails/app/app_generator.rb
@@ -78,7 +78,7 @@ def config
template "routes.rb"
template "application.rb"
template "environment.rb"
- template "tokens.yml"
+ template "secrets.yml"
directory "environments"
directory "initializers"
View
0 ...ors/rails/app/templates/config/tokens.yml → ...rs/rails/app/templates/config/secrets.yml
File renamed without changes.
View
6 railties/test/application/configuration_test.rb
@@ -304,7 +304,7 @@ def index
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 @@ def index
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 @@ def index
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

0 comments on commit bb7537b

Please sign in to comment.
Something went wrong with that request. Please try again.