Commit 70c5e3e318955c65f555f70a4e6421007ab8882c

Authored by Rafael Manzo
1 parent 9185ebc5

rails files modified accordingly to a newly generated app

This ensures that we are up-to-date with the latest configuration standards
Gemfile
... ... @@ -78,10 +78,10 @@ group :test do
78 78 end
79 79  
80 80 group :development, :test do
81   - # Call 'debugger' anywhere in the code to stop execution and get a debugger console
  81 + # Call 'byebug' anywhere in the code to stop execution and get a debugger console
82 82 gem 'byebug'
83 83  
84   - # Access an IRB console on exceptions page and /console in development
  84 + # Access an IRB console on exception pages or by using <%= console %> in views
85 85 gem 'web-console', '~> 2.0.0'
86 86  
87 87 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
... ...
app/assets/javascripts/application.js
... ... @@ -2,7 +2,7 @@
2 2 // listed below.
3 3 //
4 4 // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5   -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
  5 +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6 6 //
7 7 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 8 // compiled file.
... ...
app/assets/stylesheets/application.css
... ... @@ -3,7 +3,7 @@
3 3 * listed below.
4 4 *
5 5 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6   - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
  6 + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 7 *
8 8 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 9 * compiled file so the styles you add here take precedence over styles defined in any styles
... ...
bin/spring
1 1 #!/usr/bin/env ruby
2 2  
3   -# This file loads spring without using Bundler, in order to be fast
4   -# It gets overwritten when you run the `spring binstub` command
  3 +# This file loads spring without using Bundler, in order to be fast.
  4 +# It gets overwritten when you run the `spring binstub` command.
5 5  
6 6 unless defined?(Spring)
7 7 require "rubygems"
8 8 require "bundler"
9 9  
10   - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11   - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12   - ENV["GEM_HOME"] = ""
13   - Gem.paths = ENV
14   -
  10 + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
  11 + Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
15 12 gem "spring", match[1]
16 13 require "spring/binstub"
17 14 end
... ...
config.ru
1 1 # This file is used by Rack-based servers to start the application.
2 2  
3   -require ::File.expand_path('../config/environment', __FILE__)
  3 +require ::File.expand_path('../config/environment', __FILE__)
4 4 run Rails.application
... ...
config/application.rb
... ... @@ -21,7 +21,7 @@ module Mezuro
21 21 # config.i18n.default_locale = :de
22 22 config.i18n.enforce_available_locales = true
23 23  
24   - # For not swallow errors in after_commit/after_rollback callbacks.
  24 + # Do not swallow errors in after_commit/after_rollback callbacks.
25 25 config.active_record.raise_in_transactional_callbacks = true
26 26 end
27 27 end
... ...
config/boot.rb
1   -# Set up gems listed in the Gemfile.
2 1 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 2  
4 3 require 'bundler/setup' # Set up gems listed in the Gemfile
... ...
config/environments/production.rb
... ... @@ -16,11 +16,12 @@ Rails.application.configure do
16 16  
17 17 # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 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
  19 + # For large-scale production use, consider using a caching reverse proxy like
  20 + # NGINX, varnish or squid.
21 21  
22   - # Disable Rails's static asset server (Apache or NGINX will already do this).
23   - config.serve_static_files = false
  22 + # Disable serving static files from the `/public` folder by default since
  23 + # Apache or NGINX already handles this.
  24 + config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
24 25  
25 26 # Compress JavaScripts and CSS.
26 27 config.assets.js_compressor = :uglifier
... ... @@ -42,8 +43,9 @@ Rails.application.configure do
42 43 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43 44 # config.force_ssl = true
44 45  
45   - # Decrease the log volume.
46   - config.log_level = :info
  46 + # Use the lowest log level to ensure availability of diagnostic information
  47 + # when problems arise.
  48 + config.log_level = :debug
47 49  
48 50 # Prepend all log lines with the following tags.
49 51 # config.log_tags = [ :subdomain, :uuid ]
... ... @@ -55,7 +57,7 @@ Rails.application.configure do
55 57 config.cache_store = :mem_cache_store, "10.2.2.21", {expires_in: 1.day}
56 58  
57 59 # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58   - # config.action_controller.asset_host = "http://assets.example.com"
  60 + # config.action_controller.asset_host = 'http://assets.example.com'
59 61  
60 62 # Ignore bad email addresses and do not raise email delivery errors.
61 63 # Set this to true and configure the email server for immediate delivery to raise delivery errors.
... ...
config/environments/test.rb
... ... @@ -12,7 +12,7 @@ Rails.application.configure do
12 12 # preloads Rails for running tests, you may have to set it to true.
13 13 config.eager_load = false
14 14  
15   - # Configure static asset server for tests with Cache-Control for performance.
  15 + # Configure static file server for tests with Cache-Control for performance.
16 16 config.serve_static_files = true
17 17 config.static_cache_control = 'public, max-age=3600'
18 18  
... ...