Skip to content

Commit

Permalink
update fixture configuration files to 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mbulat committed Jul 10, 2017
1 parent b2dede4 commit 7e08baf
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 46 deletions.
3 changes: 3 additions & 0 deletions fixture_rails_root/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

module Ptest
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Expand Down
1 change: 1 addition & 0 deletions fixture_rails_root/config/cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test:
production:
adapter: redis
url: redis://localhost:6379/1
channel_prefix: rails5_test_production
2 changes: 1 addition & 1 deletion fixture_rails_root/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
default: &default
adapter: sqlite3
pool: 5
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

development:
Expand Down
2 changes: 1 addition & 1 deletion fixture_rails_root/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
}
else
config.action_controller.perform_caching = false
Expand Down
9 changes: 7 additions & 2 deletions fixture_rails_root/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Attempt to read encrypted secrets from `config/secrets.yml.enc`.
# Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
# `config/secrets.yml.key`.
config.read_encrypted_secrets = true

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
Expand Down Expand Up @@ -54,7 +59,7 @@

# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "ptest_#{Rails.env}"
# config.active_job.queue_name_prefix = "rails5_test_#{Rails.env}"
config.action_mailer.perform_caching = false

# Ignore bad email addresses and do not raise email delivery errors.
Expand All @@ -78,7 +83,7 @@
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

# Do not dump schema after migrations.
Expand Down
2 changes: 1 addition & 1 deletion fixture_rails_root/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=3600'
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
}

# Show full error reports and disable caching.
Expand Down
9 changes: 6 additions & 3 deletions fixture_rails_root/config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
24 changes: 0 additions & 24 deletions fixture_rails_root/config/initializers/new_framework_defaults.rb

This file was deleted.

3 changes: 0 additions & 3 deletions fixture_rails_root/config/initializers/session_store.rb

This file was deleted.

10 changes: 10 additions & 0 deletions fixture_rails_root/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
#
# This would use the information in config/locales/es.yml.
#
# The following keys must be escaped otherwise they will not be retrieved by
# the default I18n backend:
#
# true, false, on, off, yes, no
#
# Instead, surround them with single quotes.
#
# en:
# 'true': 'foo'
#
# To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html.

Expand Down
23 changes: 16 additions & 7 deletions fixture_rails_root/config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }

Expand All @@ -32,16 +32,25 @@
#
# preload_app!

# If you are preloading your application and using Active Record, it's
# recommended that you close any connections to the database before workers
# are forked to prevent connection leakage.
#
# before_fork do
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
# end

# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!`
# option you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, Ruby
# process is booted, this block will be run. If you are using the `preload_app!`
# option, you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, as Ruby
# cannot share connections between processes.
#
# on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end
#

# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
18 changes: 14 additions & 4 deletions fixture_rails_root/config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

# Shared secrets are available across all environments.

# shared:
# api_key: a1B2c3D4e5F6

# Environmental secrets are only available for that specific environment.

development:
secret_key_base: 9baaf15819d9064b6442cff7847389c79d59326c16937b8ef0eaa3f3e1ce8a8d4014adfc34282776d8803787d45e6c301930c3e30e4c27c42473b7065e8db237
secret_key_base: 401ae7b159569145b40b61d3d6b904eefb906c69d04afadd2a1d1e999434e4132a0981c1d0cb6e2ab16297988376a4453c4a04e8228a70efe519c93b186b4453

test:
secret_key_base: e576061b0a02fb39eadb98d3e087da40baed930527dd57d486660036d50b59017d85ac6092ffd843731b043fa2dbd8a9f5ee71a0cd2da35105723059a185578d
secret_key_base: 050d11f3cae874e96aaf3a60adfcd27c0d691ccb153f0aba8230cade3ad4b74721fc652df5ba6674f515e105bafc9dd5215bf323adbc085fce9efafc95a85760

# Do not keep production secrets in the unencrypted secrets file.
# Instead, either read values from the environment.
# Or, use `bin/rails secrets:setup` to configure encrypted secrets
# and move the `production:` environment over there.

# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

0 comments on commit 7e08baf

Please sign in to comment.