diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:15:47 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 19:15:47 +0200 |
commit | 69ab3eb57e8387b0dd9d672b5e8d9185395baa03 (patch) | |
tree | a49845496e36ba7659a863e6550fcccbb9317d7d /railties/lib/rails/application | |
parent | f8477f13bfe554064bd25a57e5289b4ebaabb504 (diff) | |
download | rails-69ab3eb57e8387b0dd9d672b5e8d9185395baa03.tar.gz rails-69ab3eb57e8387b0dd9d672b5e8d9185395baa03.tar.bz2 rails-69ab3eb57e8387b0dd9d672b5e8d9185395baa03.zip |
applies new string literal convention in railties/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/bootstrap.rb | 10 | ||||
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 14 | ||||
-rw-r--r-- | railties/lib/rails/application/default_middleware_stack.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 10 |
4 files changed, 20 insertions, 20 deletions
diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index f615f22b26..11da271501 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -1,7 +1,7 @@ -require 'fileutils' -require 'active_support/notifications' -require 'active_support/dependencies' -require 'active_support/descendants_tracker' +require "fileutils" +require "active_support/notifications" +require "active_support/dependencies" +require "active_support/descendants_tracker" module Rails class Application @@ -36,7 +36,7 @@ INFO FileUtils.mkdir_p File.dirname path end - f = File.open path, 'a' + f = File.open path, "a" f.binmode f.sync = config.autoflush_log # if true make sure every write flushes diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 285a63d4c6..810750ed35 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -1,10 +1,10 @@ -require 'active_support/core_ext/kernel/reporting' -require 'active_support/file_update_checker' -require 'rails/engine/configuration' -require 'rails/source_annotation_extractor' +require "active_support/core_ext/kernel/reporting" +require "active_support/file_update_checker" +require "rails/engine/configuration" +require "rails/source_annotation_extractor" -require 'active_support/deprecation' -require 'active_support/core_ext/string/strip' # for strip_heredoc +require "active_support/deprecation" +require "active_support/core_ext/string/strip" # for strip_heredoc module Rails class Application @@ -134,7 +134,7 @@ module Rails require "yaml" require "erb" YAML.load(ERB.new(yaml.read).result) || {} - elsif ENV['DATABASE_URL'] + elsif ENV["DATABASE_URL"] # Value from ENV['DATABASE_URL'] is set to default database connection # by Active Record. {} diff --git a/railties/lib/rails/application/default_middleware_stack.rb b/railties/lib/rails/application/default_middleware_stack.rb index 381e548730..14c0a8cbe4 100644 --- a/railties/lib/rails/application/default_middleware_stack.rb +++ b/railties/lib/rails/application/default_middleware_stack.rb @@ -19,7 +19,7 @@ module Rails if config.public_file_server.enabled headers = config.public_file_server.headers || {} - headers['Cache-Control'.freeze] = config.static_cache_control if config.static_cache_control + headers["Cache-Control".freeze] = config.static_cache_control if config.static_cache_control middleware.use ::ActionDispatch::Static, paths["public"].first, index: config.public_file_server.index_name, headers: headers end @@ -76,9 +76,9 @@ module Rails return unless rack_cache begin - require 'rack/cache' + require "rack/cache" rescue LoadError => error - error.message << ' Be sure to add rack-cache to your Gemfile' + error.message << " Be sure to add rack-cache to your Gemfile" raise end diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 64de10a5c7..9f07f8fa02 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -22,13 +22,13 @@ module Rails initializer :add_builtin_route do |app| if Rails.env.development? app.routes.prepend do - get '/rails/info/properties' => "rails/info#properties", internal: true - get '/rails/info/routes' => "rails/info#routes", internal: true - get '/rails/info' => "rails/info#index", internal: true + get "/rails/info/properties" => "rails/info#properties", internal: true + get "/rails/info/routes" => "rails/info#routes", internal: true + get "/rails/info" => "rails/info#index", internal: true end app.routes.append do - get '/' => "rails/welcome#index", internal: true + get "/" => "rails/welcome#index", internal: true end end end @@ -36,7 +36,7 @@ module Rails # Setup default session store if not already set in config/application.rb initializer :setup_default_session_store, before: :build_middleware_stack do |app| unless app.config.session_store? - app_name = app.class.name ? app.railtie_name.chomp('_application') : '' + app_name = app.class.name ? app.railtie_name.chomp("_application") : "" app.config.session_store :cookie_store, key: "_#{app_name}_session" end end |