Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 55505c9

Browse files
committed
Updated rails files for the dummy app
1 parent a10060e commit 55505c9

File tree

15 files changed

+125
-127
lines changed

15 files changed

+125
-127
lines changed

spec/dummy/bin/bundle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env ruby
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3+
load Gem.bin_path('bundler', 'bundle')

spec/dummy/bin/rails

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
APP_PATH = File.expand_path('../../config/application', __FILE__)
3+
require_relative '../config/boot'
4+
require 'rails/commands'

spec/dummy/bin/rake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
require_relative '../config/boot'
3+
require 'rake'
4+
Rake.application.run

spec/dummy/config/application.rb

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
require 'rails/all'
44

5+
# Require the gems listed in Gemfile, including any gems
6+
# you've limited to :test, :development, or :production.
57
Bundler.require(*Rails.groups)
68
require 'active_admin/globalize'
79

@@ -11,16 +13,6 @@ class Application < Rails::Application
1113
# Application configuration should go into files in config/initializers
1214
# -- all .rb files in that directory are automatically loaded.
1315

14-
# Custom directories with classes and modules you want to be autoloadable.
15-
# config.autoload_paths += %W(#{config.root}/extras)
16-
17-
# Only load the plugins named here, in the order given (default is alphabetical).
18-
# :all can be used as a placeholder for all plugins not explicitly named.
19-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20-
21-
# Activate observers that should always be running.
22-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23-
2416
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
2517
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
2618
# config.time_zone = 'Central Time (US & Canada)'
@@ -29,34 +21,6 @@ class Application < Rails::Application
2921
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
3022
config.i18n.default_locale = :en
3123
config.i18n.available_locales = [:de, :en, :hu, :it, :'pt-BR', :'pt-PT']
32-
# @see http://stackoverflow.com/questions/20361428/rails-i18n-validation-deprecation-warning
33-
I18n.config.enforce_available_locales = true
34-
35-
# Configure the default encoding used in templates for Ruby 1.9.
36-
config.encoding = "utf-8"
37-
38-
# Configure sensitive parameters which will be filtered from the log file.
39-
config.filter_parameters += [:password]
4024

41-
# Enable escaping HTML in JSON.
42-
config.active_support.escape_html_entities_in_json = true
43-
44-
# Use SQL instead of Active Record's schema dumper when creating the database.
45-
# This is necessary if your schema can't be completely dumped by the schema dumper,
46-
# like if you have constraints or database-specific column types
47-
# config.active_record.schema_format = :sql
48-
49-
# Enforce whitelist mode for mass assignment.
50-
# This will create an empty whitelist of attributes available for mass-assignment for all models
51-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
52-
# parameters by using an attr_accessible or attr_protected declaration.
53-
config.active_record.whitelist_attributes = true
54-
55-
# Enable the asset pipeline
56-
config.assets.enabled = true
57-
58-
# Version of your assets, change this if you want to expire all your assets
59-
config.assets.version = '1.0'
6025
end
6126
end
62-

spec/dummy/config/boot.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
require 'rubygems'
2-
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1+
# Set up gems listed in the Gemfile.
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
33

4-
if File.exist?(gemfile)
5-
ENV['BUNDLE_GEMFILE'] = gemfile
6-
require 'bundler'
7-
Bundler.setup
8-
end
4+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
95

106
$:.unshift File.expand_path('../../../../lib', __FILE__)

spec/dummy/config/environment.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Load the rails application
1+
# Load the Rails application.
22
require File.expand_path('../application', __FILE__)
33

4-
# Initialize the rails application
4+
# Initialize the Rails application.
55
Dummy::Application.initialize!
Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
Dummy::Application.configure do
2-
# Settings specified here will take precedence over those in config/application.rb
2+
# Settings specified here will take precedence over those in config/application.rb.
33

44
# In the development environment your application's code is reloaded on
55
# every request. This slows down response time but is perfect for development
66
# since you don't have to restart the web server when you make code changes.
77
config.cache_classes = false
88

9-
# Log error messages when you accidentally call methods on nil.
10-
config.whiny_nils = true
9+
# Do not eager load code on boot.
10+
config.eager_load = false
1111

12-
# Show full error reports and disable caching
12+
# Show full error reports and disable caching.
1313
config.consider_all_requests_local = true
1414
config.action_controller.perform_caching = false
1515

16-
# Don't care if the mailer can't send
16+
# Don't care if the mailer can't send.
1717
config.action_mailer.raise_delivery_errors = false
1818

19-
# Print deprecation notices to the Rails logger
19+
# Print deprecation notices to the Rails logger.
2020
config.active_support.deprecation = :log
2121

22-
# Only use best-standards-support built into browsers
23-
config.action_dispatch.best_standards_support = :builtin
22+
# Raise an error on page load if there are pending migrations
23+
config.active_record.migration_error = :page_load
2424

25-
# Raise exception on mass assignment protection for Active Record models
26-
config.active_record.mass_assignment_sanitizer = :strict
27-
28-
# Log the query plan for queries taking more than this (works
29-
# with SQLite, MySQL, and PostgreSQL)
30-
config.active_record.auto_explain_threshold_in_seconds = 0.5
31-
32-
# Do not compress assets
33-
config.assets.compress = false
34-
35-
# Expands the lines which load the assets
25+
# Debug mode disables concatenation and preprocessing of assets.
26+
# This option may cause significant delays in view rendering with a large
27+
# number of complex assets.
3628
config.assets.debug = true
3729
end
Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,80 @@
11
Dummy::Application.configure do
2-
# Settings specified here will take precedence over those in config/application.rb
2+
# Settings specified here will take precedence over those in config/application.rb.
33

4-
# Code is not reloaded between requests
4+
# Code is not reloaded between requests.
55
config.cache_classes = true
66

7-
# Full error reports are disabled and caching is turned on
7+
# Eager load code on boot. This eager loads most of Rails and
8+
# your application in memory, allowing both thread web servers
9+
# and those relying on copy on write to perform better.
10+
# Rake tasks automatically ignore this option for performance.
11+
config.eager_load = true
12+
13+
# Full error reports are disabled and caching is turned on.
814
config.consider_all_requests_local = false
915
config.action_controller.perform_caching = true
1016

11-
# Disable Rails's static asset server (Apache or nginx will already do this)
17+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
18+
# Add `rack-cache` to your Gemfile before enabling this.
19+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20+
# config.action_dispatch.rack_cache = true
21+
22+
# Disable Rails's static asset server (Apache or nginx will already do this).
1223
config.serve_static_assets = false
1324

14-
# Compress JavaScripts and CSS
15-
config.assets.compress = true
25+
# Compress JavaScripts and CSS.
26+
config.assets.js_compressor = :uglifier
27+
# config.assets.css_compressor = :sass
1628

17-
# Don't fallback to assets pipeline if a precompiled asset is missed
29+
# Do not fallback to assets pipeline if a precompiled asset is missed.
1830
config.assets.compile = false
1931

20-
# Generate digests for assets URLs
32+
# Generate digests for assets URLs.
2133
config.assets.digest = true
2234

23-
# Defaults to nil and saved in location specified by config.assets.prefix
24-
# config.assets.manifest = YOUR_PATH
35+
# Version of your assets, change this if you want to expire all your assets.
36+
config.assets.version = '1.0'
2537

26-
# Specifies the header that your server uses for sending files
38+
# Specifies the header that your server uses for sending files.
2739
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
2840
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
2941

3042
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
3143
# config.force_ssl = true
3244

33-
# See everything in the log (default is :info)
34-
# config.log_level = :debug
45+
# Set to :debug to see everything in the log.
46+
config.log_level = :info
3547

36-
# Prepend all log lines with the following tags
48+
# Prepend all log lines with the following tags.
3749
# config.log_tags = [ :subdomain, :uuid ]
3850

39-
# Use a different logger for distributed setups
51+
# Use a different logger for distributed setups.
4052
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
4153

42-
# Use a different cache store in production
54+
# Use a different cache store in production.
4355
# config.cache_store = :mem_cache_store
4456

45-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
57+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
4658
# config.action_controller.asset_host = "http://assets.example.com"
4759

48-
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
60+
# Precompile additional assets.
61+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
4962
# config.assets.precompile += %w( search.js )
5063

51-
# Disable delivery errors, bad email addresses will be ignored
64+
# Ignore bad email addresses and do not raise email delivery errors.
65+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
5266
# config.action_mailer.raise_delivery_errors = false
5367

54-
# Enable threaded mode
55-
# config.threadsafe!
56-
5768
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58-
# the I18n.default_locale when a translation can not be found)
69+
# the I18n.default_locale when a translation can not be found).
5970
config.i18n.fallbacks = true
6071

61-
# Send deprecation notices to registered listeners
72+
# Send deprecation notices to registered listeners.
6273
config.active_support.deprecation = :notify
6374

64-
# Log the query plan for queries taking more than this (works
65-
# with SQLite, MySQL, and PostgreSQL)
66-
# config.active_record.auto_explain_threshold_in_seconds = 0.5
75+
# Disable automatic flushing of the log to improve performance.
76+
# config.autoflush_log = false
77+
78+
# Use default logging formatter so that PID and timestamp are not suppressed.
79+
config.log_formatter = ::Logger::Formatter.new
6780
end
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
Dummy::Application.configure do
2-
# Settings specified here will take precedence over those in config/application.rb
2+
# Settings specified here will take precedence over those in config/application.rb.
33

44
# The test environment is used exclusively to run your application's
55
# test suite. You never need to work with it otherwise. Remember that
66
# your test database is "scratch space" for the test suite and is wiped
77
# and recreated between test runs. Don't rely on the data there!
88
config.cache_classes = true
99

10-
# Configure static asset server for tests with Cache-Control for performance
11-
config.serve_static_assets = true
12-
config.static_cache_control = "public, max-age=3600"
10+
# Do not eager load code on boot. This avoids loading your whole application
11+
# just for the purpose of running a single test. If you are using a tool that
12+
# preloads Rails for running tests, you may have to set it to true.
13+
config.eager_load = false
1314

14-
# Log error messages when you accidentally call methods on nil
15-
config.whiny_nils = true
15+
# Configure static asset server for tests with Cache-Control for performance.
16+
config.serve_static_assets = true
17+
config.static_cache_control = "public, max-age=3600"
1618

17-
# Show full error reports and disable caching
19+
# Show full error reports and disable caching.
1820
config.consider_all_requests_local = true
1921
config.action_controller.perform_caching = false
2022

21-
# Raise exceptions instead of rendering exception templates
23+
# Raise exceptions instead of rendering exception templates.
2224
config.action_dispatch.show_exceptions = false
2325

24-
# Disable request forgery protection in test environment
25-
config.action_controller.allow_forgery_protection = false
26+
# Disable request forgery protection in test environment.
27+
config.action_controller.allow_forgery_protection = false
2628

2729
# Tell Action Mailer not to deliver emails to the real world.
2830
# The :test delivery method accumulates sent emails in the
2931
# ActionMailer::Base.deliveries array.
3032
config.action_mailer.delivery_method = :test
3133

32-
# Raise exception on mass assignment protection for Active Record models
33-
config.active_record.mass_assignment_sanitizer = :strict
34-
35-
# Print deprecation notices to the stderr
34+
# Print deprecation notices to the stderr.
3635
config.active_support.deprecation = :stderr
3736
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Be sure to restart your server when you modify this file.
2+
3+
# Configure sensitive parameters which will be filtered from the log file.
4+
Rails.application.config.filter_parameters += [:password]

0 commit comments

Comments
 (0)