From db5f1a46f26ed2b8359d3dde3398dd1a8ca443d4 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Mon, 27 Oct 2014 12:04:37 -0500 Subject: `secret_token` is now saved in `Rails.application.secrets.secret_token` - `secrets.secret_token` is now used in all places `config.secret_token` was - `secrets.secret_token`, when not present in `config/secrets.yml`, now falls back to the value of `config.secret_token` - when `secrets.secret_token` is set, it over-writes `config.secret_token` so they are the same (for backwards-compatibility) - Update docs to reference app.secrets in all places - Remove references to `config.secret_token`, `config.secret_key_base` - Warn that missing secret_key_base is deprecated - Add tests for secret_token, key_generator, and message_verifier - the legacy key generator is used with the message verifier when secrets.secret_key_base is blank and secret_token is set - app.key_generator raises when neither secrets.secret_key_base nor secret_token are set - app.env_config raises when neither secrets.secret_key_base nor secret_token are set - Add changelog Run focused tests via ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/' --- railties/lib/rails/application.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index bc966e87c6..78b8a90432 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -175,7 +175,7 @@ module Rails key_generator = ActiveSupport::KeyGenerator.new(secrets.secret_key_base, iterations: 1000) ActiveSupport::CachingKeyGenerator.new(key_generator) else - ActiveSupport::LegacyKeyGenerator.new(config.secret_token) + ActiveSupport::LegacyKeyGenerator.new(secrets.secret_token) end end @@ -245,7 +245,7 @@ module Rails super.merge({ "action_dispatch.parameter_filter" => config.filter_parameters, "action_dispatch.redirect_filter" => config.filter_redirect, - "action_dispatch.secret_token" => config.secret_token, + "action_dispatch.secret_token" => secrets.secret_token, "action_dispatch.secret_key_base" => secrets.secret_key_base, "action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions, "action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local, @@ -378,6 +378,13 @@ module Rails # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base + # Sync secrets.secret_token with config.secret_token, preferring secrets.secret_token + # note that unset config's default to "", secrets default to nil + if secrets.secret_token.blank? && config.secret_token.present? + secrets.secret_token = config.secret_token + elsif secrets.secret_token.present? + config.secret_token = secrets.secret_token + end secrets end @@ -507,8 +514,13 @@ module Rails end def validate_secret_key_config! #:nodoc: - if secrets.secret_key_base.blank? && config.secret_token.blank? - raise "Missing `secret_key_base` for '#{Rails.env}' environment, set this value in `config/secrets.yml`" + if secrets.secret_key_base.blank? + ActiveSupport::Deprecation.warn "You didn't set `secret_key_base`. " + + "Read the upgrade documentation to learn more about this new config option." + + if secrets.secret_token.blank? + raise "Missing `secret_token` and `secret_key_base` for '#{Rails.env}' environment, set these values in `config/secrets.yml`" + end end end end -- cgit v1.2.3 From 9dbcac78113808da23dfe1e3e7b0cc6a390e03be Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 4 Nov 2014 14:54:52 -0800 Subject: add lib to $LOAD_PATH on application inhertence. fixes #17106 --- railties/lib/rails/application.rb | 13 ++++++++----- railties/lib/rails/engine.rb | 9 ++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index bc966e87c6..18d9cb72d6 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -88,6 +88,7 @@ module Rails def inherited(base) super Rails.app_class = base + add_lib_to_load_path!(find_root(base.called_from)) end def instance @@ -98,6 +99,10 @@ module Rails new(initial_variable_values, &block).run_load_hooks! end + def find_root(from) + find_root_with_flag "config.ru", from, Dir.pwd + end + # Makes the +new+ method public. # # Note that Rails::Application inherits from Rails::Engine, which @@ -129,8 +134,6 @@ module Rails # are these actually used? @initial_variable_values = initial_variable_values @block = block - - add_lib_to_load_path! end # Returns true if the application is initialized. @@ -313,8 +316,8 @@ module Rails # are changing config.root inside your application definition or having a custom # Rails application, you will need to add lib to $LOAD_PATH on your own in case # you need to load files in lib/ during the application configuration as well. - def add_lib_to_load_path! #:nodoc: - path = File.join config.root, 'lib' + def self.add_lib_to_load_path!(root) #:nodoc: + path = File.join root, 'lib' if File.exist?(path) && !$LOAD_PATH.include?(path) $LOAD_PATH.unshift(path) end @@ -358,7 +361,7 @@ module Rails end def config #:nodoc: - @config ||= Application::Configuration.new(find_root_with_flag("config.ru", Dir.pwd)) + @config ||= Application::Configuration.new(self.class.find_root(self.class.called_from)) end def config=(configuration) #:nodoc: diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index dc3da1eb41..d985518fd9 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -364,6 +364,10 @@ module Rails super end + def find_root(from) + find_root_with_flag "lib", from + end + def endpoint(endpoint = nil) @endpoint ||= nil @endpoint = endpoint if endpoint @@ -531,7 +535,7 @@ module Rails # Define the configuration object for the engine. def config - @config ||= Engine::Configuration.new(find_root_with_flag("lib")) + @config ||= Engine::Configuration.new(self.class.find_root(self.class.called_from)) end # Load data from db/seeds.rb file. It can be used in to load engines' @@ -658,8 +662,7 @@ module Rails paths["db/migrate"].existent.any? end - def find_root_with_flag(flag, default=nil) #:nodoc: - root_path = self.class.called_from + def self.find_root_with_flag(flag, root_path, default=nil) #:nodoc: while root_path && File.directory?(root_path) && !File.exist?("#{root_path}/#{flag}") parent = File.dirname(root_path) -- cgit v1.2.3 From 9511801a6de3ad48a0bd9a8ab57e02e2186e154d Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Wed, 5 Nov 2014 14:17:37 +0100 Subject: Add test/jobs files in `rake stats` --- railties/lib/rails/code_statistics.rb | 1 + railties/lib/rails/tasks/statistics.rake | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb index 0ae6d2a455..27779857b7 100644 --- a/railties/lib/rails/code_statistics.rb +++ b/railties/lib/rails/code_statistics.rb @@ -6,6 +6,7 @@ class CodeStatistics #:nodoc: 'Helper tests', 'Model tests', 'Mailer tests', + 'Job tests', 'Integration tests', 'Functional tests (old)', 'Unit tests (old)'] diff --git a/railties/lib/rails/tasks/statistics.rake b/railties/lib/rails/tasks/statistics.rake index b94cd244be..4f09ded31d 100644 --- a/railties/lib/rails/tasks/statistics.rake +++ b/railties/lib/rails/tasks/statistics.rake @@ -14,10 +14,11 @@ STATS_DIRECTORIES = [ %w(Helper\ tests test/helpers), %w(Model\ tests test/models), %w(Mailer\ tests test/mailers), + %w(Job\ tests test/jobs), %w(Integration\ tests test/integration), %w(Functional\ tests\ (old) test/functional), %w(Unit\ tests \ (old) test/unit) -].collect do |name, dir| +].collect do |name, dir| [ name, "#{File.dirname(Rake.application.rakefile_location)}/#{dir}" ] end.select { |name, dir| File.directory?(dir) } -- cgit v1.2.3 From 001e600619c7ec5d7535e47c5900bcad259de3f8 Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Sat, 8 Nov 2014 16:40:13 -0800 Subject: Documenting Rails::Info module [ci skip] --- railties/lib/rails/info.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/info.rb b/railties/lib/rails/info.rb index 357aebf584..94ede76932 100644 --- a/railties/lib/rails/info.rb +++ b/railties/lib/rails/info.rb @@ -1,6 +1,9 @@ require "cgi" module Rails + # This module helps build the runtime properties used to display in the + # Rails::InfoController responses. Including the active Rails version, Ruby + # version, Rack version, and so on. module Info mattr_accessor :properties class << (@@properties = []) -- cgit v1.2.3 From 9cf3596da50fb1c157ce1995754c1b7e810b9611 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 9 Nov 2014 11:53:51 +0900 Subject: Fix comment of SourceAnnotationExtractor#find_in Commit(810af6f) changed which extensions are taken into account, so make to match comment of find_in. And sort extensions to follow the added order. --- railties/lib/rails/source_annotation_extractor.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/source_annotation_extractor.rb b/railties/lib/rails/source_annotation_extractor.rb index 201532d299..9b058a1848 100644 --- a/railties/lib/rails/source_annotation_extractor.rb +++ b/railties/lib/rails/source_annotation_extractor.rb @@ -80,9 +80,8 @@ class SourceAnnotationExtractor # Returns a hash that maps filenames under +dir+ (recursively) to arrays # with their annotations. Only files with annotations are included. Files - # with extension +.builder+, +.rb+, +.erb+, +.haml+, +.slim+, +.css+, - # +.scss+, +.js+, +.coffee+, +.rake+, +.sass+ and +.less+ - # are taken into account. + # with extension +.builder+, +.rb+, +.rake+, +.yml+, +.yaml+, +.ruby+, + # +.css+, +.js+ and +.erb+ are taken into account. def find_in(dir) results = {} -- cgit v1.2.3 From 30af171af13293aa37bee612ae7b976d3ede0439 Mon Sep 17 00:00:00 2001 From: Rishi Jain Date: Mon, 10 Nov 2014 08:11:49 +0530 Subject: added description for rails generators, and fixed sentence formation for active_support/notifications [ci skip] --- railties/lib/rails/commands/destroy.rb | 2 ++ railties/lib/rails/commands/generate.rb | 2 ++ 2 files changed, 4 insertions(+) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/destroy.rb b/railties/lib/rails/commands/destroy.rb index 5479da86a0..ce26cc3fde 100644 --- a/railties/lib/rails/commands/destroy.rb +++ b/railties/lib/rails/commands/destroy.rb @@ -1,5 +1,7 @@ require 'rails/generators' +#if no argument/-h/--help is passed to rails destroy command, then +#it generates the help associated. if [nil, "-h", "--help"].include?(ARGV.first) Rails::Generators.help 'destroy' exit diff --git a/railties/lib/rails/commands/generate.rb b/railties/lib/rails/commands/generate.rb index 351c59c645..926c36b967 100644 --- a/railties/lib/rails/commands/generate.rb +++ b/railties/lib/rails/commands/generate.rb @@ -1,5 +1,7 @@ require 'rails/generators' +#if no argument/-h/--help is passed to rails generate command, then +#it generates the help associated. if [nil, "-h", "--help"].include?(ARGV.first) Rails::Generators.help 'generate' exit -- cgit v1.2.3 From 1d1239d32856b32b19c04edd17d0dd0d47611586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 10 Nov 2014 21:18:57 -0200 Subject: No need to sync config.secret_token and secrets.secret_token Just prefer secrets over config --- railties/lib/rails/application.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index ae60337af2..f8bd6096f2 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -381,13 +381,8 @@ module Rails # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base - # Sync secrets.secret_token with config.secret_token, preferring secrets.secret_token - # note that unset config's default to "", secrets default to nil - if secrets.secret_token.blank? && config.secret_token.present? - secrets.secret_token = config.secret_token - elsif secrets.secret_token.present? - config.secret_token = secrets.secret_token - end + # Fallback to config.secret_token if secrets.secret_token isn't set + secrets.secret_token ||= config.secret_token secrets end -- cgit v1.2.3 From d4ce2bb06d6479a99657617294a4fe7fd6cafa73 Mon Sep 17 00:00:00 2001 From: claudiob Date: Sat, 8 Nov 2014 10:58:44 -0800 Subject: Remove unnecessary double space Replaces the following in two places: ```diff -require ::File.expand_path('../config/environment', __FILE__) +require ::File.expand_path('../config/environment', __FILE__) ``` --- railties/lib/rails/generators/rails/app/templates/bin/rails | 2 +- railties/lib/rails/generators/rails/app/templates/config.ru | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/bin/rails b/railties/lib/rails/generators/rails/app/templates/bin/rails index 6a128b95e5..80ec8080ab 100644 --- a/railties/lib/rails/generators/rails/app/templates/bin/rails +++ b/railties/lib/rails/generators/rails/app/templates/bin/rails @@ -1,3 +1,3 @@ -APP_PATH = File.expand_path('../../config/application', __FILE__) +APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/railties/lib/rails/generators/rails/app/templates/config.ru b/railties/lib/rails/generators/rails/app/templates/config.ru index 5bc2a619e8..bd83b25412 100644 --- a/railties/lib/rails/generators/rails/app/templates/config.ru +++ b/railties/lib/rails/generators/rails/app/templates/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. -require ::File.expand_path('../config/environment', __FILE__) +require ::File.expand_path('../config/environment', __FILE__) run Rails.application -- cgit v1.2.3 From 3b12abba3c4fa0dbd6e8c92bd68fa433847d142c Mon Sep 17 00:00:00 2001 From: David Geukers Date: Tue, 21 Oct 2014 15:13:09 -0400 Subject: Simplify rake test vs rake test:all Renames `rake test:all` to `rake test` by changing old `rake test:run` to previous version of `rake test:all`. Removes old definition of `rake test`. Also renames `rake test:all:db` to `rake test:db` and deprecates `rake test:all` & `rake test:all:db` --- railties/lib/rails/test_unit/testing.rake | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 957deb8a60..0d0cfa3c6b 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -3,7 +3,7 @@ require 'rails/test_unit/sub_test_task' task default: :test -desc 'Runs test:units, test:functionals, test:generators, test:integration, test:jobs together' +desc "Runs all tests in test folder" task :test do Rails::TestTask.test_creator(Rake.application.top_level_tasks).invoke_rake_task end @@ -13,17 +13,34 @@ namespace :test do # Placeholder task for other Railtie and plugins to enhance. See Active Record for an example. end - task :run => ['test:units', 'test:functionals', 'test:generators', 'test:integration', 'test:jobs'] + Rails::TestTask.new(:run) do |t| + t.pattern = "test/**/*_test.rb" + end + + desc "Run tests quickly, but also reset db" + task :db => %w[db:test:prepare test] - # Inspired by: http://ngauthier.com/2012/02/quick-tests-with-bash.html desc "Run tests quickly by merging all types and not resetting db" Rails::TestTask.new(:all) do |t| t.pattern = "test/**/*_test.rb" end + Rake::Task["test:all"].enhance do + Rake::Task["test:deprecate_all"].invoke + end + + task :deprecate_all do + ActiveSupport::Deprecation.warn "rake test:all is deprecated and will be removed in Rails 5. " \ + "Use rake test to run all tests in test directory." + end + namespace :all do desc "Run tests quickly, but also reset db" task :db => %w[db:test:prepare test:all] + + Rake::Task["test:all:db"].enhance do + Rake::Task["test:deprecate_all"].invoke + end end Rails::TestTask.new(single: "test:prepare") -- cgit v1.2.3 From 56dc95bc92301dae89e5d6b5ca306b043b095661 Mon Sep 17 00:00:00 2001 From: Igor Kapkov Date: Wed, 12 Nov 2014 16:27:42 +0800 Subject: Fix Rails::Paths::Path.unshift interface --- railties/lib/rails/paths.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 3eb66c07af..d11804af17 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -167,8 +167,8 @@ module Rails @paths.concat paths end - def unshift(path) - @paths.unshift path + def unshift(*paths) + @paths.unshift(*paths) end def to_ary -- cgit v1.2.3 From 2cfaa22d3829e89ff06cfdc5467e16a7921c62ef Mon Sep 17 00:00:00 2001 From: michaeljayt Date: Mon, 17 Nov 2014 02:42:29 +0800 Subject: Skip spring install in Cygwin due to fork() bad support. See also: https://www.cygwin.com/faq.html#faq.using.fixing-fork-failures --- railties/lib/rails/generators/app_base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 92ed9136a0..b651623b53 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -342,7 +342,7 @@ module Rails end def spring_install? - !options[:skip_spring] && Process.respond_to?(:fork) + !options[:skip_spring] && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin") end def run_bundle -- cgit v1.2.3 From 6f57e1240eed636a6f47f131a9f39360e28a80c4 Mon Sep 17 00:00:00 2001 From: George Millo Date: Mon, 17 Nov 2014 15:26:33 +0700 Subject: Minor English fixes in docs [ci skip] --- railties/lib/rails/engine.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index d985518fd9..023ea98145 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -110,8 +110,8 @@ module Rails # # == Endpoint # - # An engine can be also a rack application. It can be useful if you have a rack application that - # you would like to wrap with +Engine+ and provide some of the +Engine+'s features. + # An engine can also be a rack application. It can be useful if you have a rack application that + # you would like to wrap with +Engine+ and provide with some of the +Engine+'s features. # # To do that, use the +endpoint+ method: # -- cgit v1.2.3 From 402cc9f46acfd1ff172fdff5bc99f397d498607d Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Mon, 17 Nov 2014 03:42:00 -0800 Subject: Revert "Merge pull request #16622 from matthewd/default-debug" This reverts commit 2602a49a8600ab52f807599bbd5b1f9c0be4214f, reversing changes made to 5d7c1057684c377bc2801c8851e99ff11ab23530. The explicit default was introduced in 21f6d72, so apps created with Rails < 4 have the commented out version, which means that this change would break those apps. --- railties/lib/rails/application/configuration.rb | 2 +- .../rails/app/templates/config/environments/production.rb.tt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 786dcee007..8a5bce64a0 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -118,7 +118,7 @@ module Rails end def log_level - @log_level ||= :debug + @log_level ||= Rails.env.production? ? :info : :debug end def colorize_logging diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 92ff0de030..aa7b93f0a1 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -45,8 +45,8 @@ Rails.application.configure do # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Decrease the log volume. - # config.log_level = :info + # Set to :info to decrease the log volume. + config.log_level = :debug # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] -- cgit v1.2.3 From a6de6f508c6566af098999ca70f93ee8023bc9a5 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Mon, 17 Nov 2014 04:17:23 -0800 Subject: Deprecate different default for `log_level` in production This is a more conservative approach to 2602a49. Also changed the comment to be more inline with everything else in the file (describing what the config value is doing and why). People should just read the docs for alternatives. --- railties/lib/rails/application/bootstrap.rb | 13 +++++++++++++ railties/lib/rails/application/configuration.rb | 13 +++++++++++-- .../app/templates/config/environments/production.rb.tt | 3 ++- 3 files changed, 26 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index 0f4d932749..92ecc29a5f 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -1,5 +1,6 @@ require "active_support/notifications" require "active_support/dependencies" +require "active_support/deprecation" require "active_support/descendants_tracker" module Rails @@ -54,6 +55,18 @@ INFO logger end + if Rails.env.production? && !config.has_explicit_log_level? + ActiveSupport::Deprecation.warn \ + "You did not specify a `log_level` in `production.rb`. Currently, " \ + "the default value for `log_leve` is `:info` for the production " \ + "environment and `:debug` in all other environments. In Rails 5 " \ + "the default value will be unified to `:debug` across all " \ + "environments. To preserve the current setting, add the following " \ + "line to your `production.rb`:\n" \ + "\n" \ + " config.log_level = :info\n\n" + end + Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase) end diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 8a5bce64a0..268ef2c7aa 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -15,7 +15,6 @@ module Rails :time_zone, :reload_classes_only_on_change, :beginning_of_week, :filter_redirect, :x - attr_writer :log_level attr_reader :encoding def initialize(*) @@ -34,6 +33,7 @@ module Rails @session_options = {} @time_zone = "UTC" @beginning_of_week = :monday + @has_explicit_log_level = false @log_level = nil @middleware = app_middleware @generators = app_generators @@ -117,8 +117,17 @@ module Rails raise e, "Cannot load `Rails.application.database_configuration`:\n#{e.message}", e.backtrace end + def has_explicit_log_level? # :nodoc: + @has_explicit_log_level + end + + def log_level=(level) + @has_explicit_log_level = !!(level) + @log_level = level + end + def log_level - @log_level ||= Rails.env.production? ? :info : :debug + @log_level ||= (Rails.env.production? ? :info : :debug) end def colorize_logging diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index aa7b93f0a1..91dea5858f 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -45,7 +45,8 @@ Rails.application.configure do # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Set to :info to decrease the log volume. + # Use the lowest log_level to ensure availability of diagnostic information + # when problems arise. config.log_level = :debug # Prepend all log lines with the following tags. -- cgit v1.2.3 From c7727559e1df44e5930983901949e035b6346774 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Mon, 17 Nov 2014 04:23:00 -0800 Subject: Meant to describe the concept, not the setting [ci skip] --- .../generators/rails/app/templates/config/environments/production.rb.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 91dea5858f..ddc04d446c 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -45,7 +45,7 @@ Rails.application.configure do # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Use the lowest log_level to ensure availability of diagnostic information + # Use the lowest log level to ensure availability of diagnostic information # when problems arise. config.log_level = :debug -- cgit v1.2.3 From 1966ecf6687d62e1130d862be7f86c5b1b56e341 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 17 Nov 2014 23:45:58 +0800 Subject: Fix typo. --- railties/lib/rails/application/bootstrap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index 92ecc29a5f..71d3febde4 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -58,7 +58,7 @@ INFO if Rails.env.production? && !config.has_explicit_log_level? ActiveSupport::Deprecation.warn \ "You did not specify a `log_level` in `production.rb`. Currently, " \ - "the default value for `log_leve` is `:info` for the production " \ + "the default value for `log_level` is `:info` for the production " \ "environment and `:debug` in all other environments. In Rails 5 " \ "the default value will be unified to `:debug` across all " \ "environments. To preserve the current setting, add the following " \ -- cgit v1.2.3 From 916731686ba2b48abf96251639fdb8b8af63814c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 17 Nov 2014 16:44:15 -0200 Subject: Generate new applications with the right rails-dom-testing version --- railties/lib/rails/generators/app_base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index b651623b53..5f8c33c713 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -195,9 +195,11 @@ module Rails def rails_gemfile_entry if options.dev? - [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH)] + [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH), + GemfileEntry.github('rails-dom-testing', 'rails/rails-dom-testing')] elsif options.edge? - [GemfileEntry.github('rails', 'rails/rails')] + [GemfileEntry.github('rails', 'rails/rails'), + GemfileEntry.github('rails-dom-testing', 'rails/rails-dom-testing')] else [GemfileEntry.version('rails', Rails::VERSION::STRING, -- cgit v1.2.3 From f245fe856d424cfce623f45d346f5618e1ed0840 Mon Sep 17 00:00:00 2001 From: Shunsuke Aida Date: Fri, 21 Nov 2014 09:50:46 +0900 Subject: if you want to ignore all the logfiles, no need for extensions --- railties/lib/rails/generators/rails/app/templates/gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/gitignore b/railties/lib/rails/generators/rails/app/templates/gitignore index 8775e5e235..ee61b7c5a8 100644 --- a/railties/lib/rails/generators/rails/app/templates/gitignore +++ b/railties/lib/rails/generators/rails/app/templates/gitignore @@ -14,5 +14,5 @@ <% end -%> # Ignore all logfiles and tempfiles. -/log/*.log +/log /tmp -- cgit v1.2.3 From 8ffc8da71360f0defcc4ac44d25c1732b3f73820 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Fri, 21 Nov 2014 09:25:22 +0100 Subject: ignore all logfiles but keep the log directory. #17700 [ci skip] We generate a `.keep` file inside the log directory to make sure the directory itself is under version control. let's keep it that way. /cc @matthewd --- railties/lib/rails/generators/rails/app/templates/gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/gitignore b/railties/lib/rails/generators/rails/app/templates/gitignore index ee61b7c5a8..7c6f2098b8 100644 --- a/railties/lib/rails/generators/rails/app/templates/gitignore +++ b/railties/lib/rails/generators/rails/app/templates/gitignore @@ -14,5 +14,6 @@ <% end -%> # Ignore all logfiles and tempfiles. -/log +/log/* +!/log/.keep /tmp -- cgit v1.2.3 From 38cfaa828502b2f5d137a6a2952c68ae5efc15b1 Mon Sep 17 00:00:00 2001 From: Andy Jeffries Date: Mon, 17 Nov 2014 10:44:04 +0000 Subject: Creates an ApplicationMailer and layout by default, including html and body tags to reduce spam score --- .../rails/generators/erb/mailer/mailer_generator.rb | 20 ++++++++++++++++++++ .../generators/erb/mailer/templates/layout.html.erb | 5 +++++ .../generators/erb/mailer/templates/layout.text.erb | 1 + 3 files changed, 26 insertions(+) create mode 100644 railties/lib/rails/generators/erb/mailer/templates/layout.html.erb create mode 100644 railties/lib/rails/generators/erb/mailer/templates/layout.text.erb (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index 66b17bd10e..b047973241 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -3,6 +3,26 @@ require 'rails/generators/erb/controller/controller_generator' module Erb # :nodoc: module Generators # :nodoc: class MailerGenerator < ControllerGenerator # :nodoc: + def copy_view_files + view_base_path = File.join("app/views", class_path, file_name) + empty_directory view_base_path + + layout_base_path = File.join("app/views/layouts") + + actions.each do |action| + @action = action + + formats.each do |format| + @view_path = File.join(view_base_path, filename_with_extensions(action, format)) + template filename_with_extensions(:view, format), @view_path + + @layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format)) + template filename_with_extensions(:layout, format), @layout_path + end + end + + end + protected def formats diff --git a/railties/lib/rails/generators/erb/mailer/templates/layout.html.erb b/railties/lib/rails/generators/erb/mailer/templates/layout.html.erb new file mode 100644 index 0000000000..93110e74ad --- /dev/null +++ b/railties/lib/rails/generators/erb/mailer/templates/layout.html.erb @@ -0,0 +1,5 @@ + + + <%%= yield %> + + diff --git a/railties/lib/rails/generators/erb/mailer/templates/layout.text.erb b/railties/lib/rails/generators/erb/mailer/templates/layout.text.erb new file mode 100644 index 0000000000..6363733e6e --- /dev/null +++ b/railties/lib/rails/generators/erb/mailer/templates/layout.text.erb @@ -0,0 +1 @@ +<%%= yield %> -- cgit v1.2.3 From a58da25d90962a39ad916fc4de22a0a0c81ba034 Mon Sep 17 00:00:00 2001 From: Andy Jeffries Date: Mon, 24 Nov 2014 09:37:32 +0000 Subject: Removing unnecessary File.join calls --- railties/lib/rails/generators/erb/mailer/mailer_generator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index b047973241..1e290bb938 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -7,7 +7,7 @@ module Erb # :nodoc: view_base_path = File.join("app/views", class_path, file_name) empty_directory view_base_path - layout_base_path = File.join("app/views/layouts") + layout_base_path = "app/views/layouts" actions.each do |action| @action = action -- cgit v1.2.3 From 47ca6664fb51823709cc8fbcfa5cea510da18879 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Mon, 24 Nov 2014 19:48:51 +0900 Subject: Replace ActionDispatch::Head with Rack::Head. --- railties/lib/rails/configuration.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index f5d7dede66..f99cec04c5 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -18,11 +18,11 @@ module Rails # This will put the Magical::Unicorns middleware on the end of the stack. # You can use +insert_before+ if you wish to add a middleware before another: # - # config.middleware.insert_before ActionDispatch::Head, Magical::Unicorns + # config.middleware.insert_before Rack::Head, Magical::Unicorns # # There's also +insert_after+ which will insert a middleware after another: # - # config.middleware.insert_after ActionDispatch::Head, Magical::Unicorns + # config.middleware.insert_after Rack::Head, Magical::Unicorns # # Middlewares can also be completely swapped out and replaced with others: # -- cgit v1.2.3 From 7b378403d334fdfccfae64261df9cd5865b805d8 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Mon, 24 Nov 2014 09:42:58 -0500 Subject: Change 'of plugins' syntax Currently, the docs uses a syntax that is unclear and not general American English. I've switched it to be clearer wording. Not a big fix, but may be helpful. --- .../rails/app/templates/app/assets/javascripts/application.js.tt | 2 +- .../rails/app/templates/app/assets/stylesheets/application.css | 2 +- .../lib/rails/generators/rails/plugin/templates/rails/javascripts.js | 2 +- .../lib/rails/generators/rails/plugin/templates/rails/stylesheets.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt index 07ea09cdbd..c1a77944e8 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +++ b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt @@ -2,7 +2,7 @@ // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css b/railties/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css index a443db3401..f9cd5b3483 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css +++ b/railties/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css @@ -3,7 +3,7 @@ * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any styles diff --git a/railties/lib/rails/generators/rails/plugin/templates/rails/javascripts.js b/railties/lib/rails/generators/rails/plugin/templates/rails/javascripts.js index 5bc2e1c8b5..c28e5badc6 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/rails/javascripts.js +++ b/railties/lib/rails/generators/rails/plugin/templates/rails/javascripts.js @@ -2,7 +2,7 @@ // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. diff --git a/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css b/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css index a443db3401..c07accc219 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css +++ b/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css @@ -3,7 +3,7 @@ * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any styles -- cgit v1.2.3 From 746c3741e7011580efa69ab3fd1d5eb55e4f3348 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Mon, 24 Nov 2014 10:25:09 -0500 Subject: Fix wrong path in comments about stylesheets I put the wrong path in my last PR by accident. Fixed here. Related to #17742 --- .../lib/rails/generators/rails/plugin/templates/rails/stylesheets.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css b/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css index c07accc219..f9cd5b3483 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css +++ b/railties/lib/rails/generators/rails/plugin/templates/rails/stylesheets.css @@ -3,7 +3,7 @@ * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. + * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any styles -- cgit v1.2.3 From 8e1e9f6c70e626e51b158511fb9ef417f04e5397 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Mon, 24 Nov 2014 15:48:43 -0500 Subject: Fix sprockets-rails dependency dance - Remove sprockets-rails from generated Gemfile as rails has a hard-dependency on it - Also allow sprockets-rails >= 2.0.0 --- railties/lib/rails/generators/app_base.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 5f8c33c713..ec32bb8efc 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -239,8 +239,6 @@ module Rails gems = [] if options.dev? || options.edge? - gems << GemfileEntry.github('sprockets-rails', 'rails/sprockets-rails', - 'Use edge version of sprockets-rails') gems << GemfileEntry.github('sass-rails', 'rails/sass-rails', 'Use SCSS for stylesheets') else -- cgit v1.2.3 From b8d8ce7ba8e5e83e9b41e48fb6ef449bd36a97e3 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 25 Nov 2014 09:14:59 +0800 Subject: Add tests which were incorrectly removed. --- railties/lib/rails/generators/erb/mailer/mailer_generator.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index 1e290bb938..a228484c11 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -13,11 +13,11 @@ module Erb # :nodoc: @action = action formats.each do |format| - @view_path = File.join(view_base_path, filename_with_extensions(action, format)) - template filename_with_extensions(:view, format), @view_path + @path = File.join(view_base_path, filename_with_extensions(action, format)) + template filename_with_extensions(:view, format), @path - @layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format)) - template filename_with_extensions(:layout, format), @layout_path + layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format)) + template filename_with_extensions(:layout, format), layout_path end end -- cgit v1.2.3 From 35628a44b2b8ccf6d1931222447c5ab27b19c7e7 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 25 Nov 2014 09:16:11 +0800 Subject: MailerGenerator should inherit from Base. --- railties/lib/rails/generators/erb/mailer/mailer_generator.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index a228484c11..e2f142fd02 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -1,8 +1,10 @@ -require 'rails/generators/erb/controller/controller_generator' +require 'rails/generators/erb' module Erb # :nodoc: module Generators # :nodoc: - class MailerGenerator < ControllerGenerator # :nodoc: + class MailerGenerator < Base # :nodoc: + argument :actions, type: :array, default: [], banner: "method method" + def copy_view_files view_base_path = File.join("app/views", class_path, file_name) empty_directory view_base_path @@ -20,7 +22,6 @@ module Erb # :nodoc: template filename_with_extensions(:layout, format), layout_path end end - end protected -- cgit v1.2.3 From 7a47690a13f403278036f38b69465167466f6b5f Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 25 Nov 2014 09:21:37 +0800 Subject: Generate mailer layouts even if no action is given. --- railties/lib/rails/generators/erb/mailer/mailer_generator.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index e2f142fd02..f9b3658ae7 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -9,7 +9,10 @@ module Erb # :nodoc: view_base_path = File.join("app/views", class_path, file_name) empty_directory view_base_path - layout_base_path = "app/views/layouts" + formats.each do |format| + layout_path = File.join("app/views/layouts", filename_with_extensions("mailer", format)) + template filename_with_extensions(:layout, format), layout_path + end actions.each do |action| @action = action @@ -17,9 +20,6 @@ module Erb # :nodoc: formats.each do |format| @path = File.join(view_base_path, filename_with_extensions(action, format)) template filename_with_extensions(:view, format), @path - - layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format)) - template filename_with_extensions(:layout, format), layout_path end end end -- cgit v1.2.3 From 1c61b74ce2844e9d41e7f3ecb9e0bd9d11db201a Mon Sep 17 00:00:00 2001 From: Peter Schrammel Date: Tue, 25 Nov 2014 08:56:01 +0100 Subject: be more general with adapter name --- railties/lib/rails/commands/dbconsole.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index 1a2613a8d0..cb0936d1ef 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -44,7 +44,7 @@ module Rails find_cmd_and_exec(['mysql', 'mysql5'], *args) - when "postgresql", "postgres", "postgis" + when /postgres|postgis/ ENV['PGUSER'] = config["username"] if config["username"] ENV['PGHOST'] = config["host"] if config["host"] ENV['PGPORT'] = config["port"].to_s if config["port"] -- cgit v1.2.3 From e3f7817cec95ac395c9e1491178a1fad0a73af63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 25 Nov 2014 19:42:17 -0200 Subject: Use released rails-dom-testing --- railties/lib/rails/generators/app_base.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index ec32bb8efc..e8dfc33915 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -196,10 +196,8 @@ module Rails def rails_gemfile_entry if options.dev? [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH), - GemfileEntry.github('rails-dom-testing', 'rails/rails-dom-testing')] elsif options.edge? [GemfileEntry.github('rails', 'rails/rails'), - GemfileEntry.github('rails-dom-testing', 'rails/rails-dom-testing')] else [GemfileEntry.version('rails', Rails::VERSION::STRING, -- cgit v1.2.3 From ac0432cf351d11f9cfaf2eb879388eb8bcf09cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 25 Nov 2014 20:15:46 -0200 Subject: Fix syntax error :bomb: --- railties/lib/rails/generators/app_base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index e8dfc33915..be79f37e94 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -195,9 +195,9 @@ module Rails def rails_gemfile_entry if options.dev? - [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH), + [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH)] elsif options.edge? - [GemfileEntry.github('rails', 'rails/rails'), + [GemfileEntry.github('rails', 'rails/rails')] else [GemfileEntry.version('rails', Rails::VERSION::STRING, -- cgit v1.2.3 From 7f864ccd65212834beb3464bcd4917db8e57aa4d Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Wed, 26 Nov 2014 00:04:25 +0200 Subject: Use web_console 2.0 for 4.2.0.rc1 release This one replaces the notable web-console mentions in guide and the default Gemfile. --- railties/lib/rails/generators/rails/app/templates/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 5961f7515c..7027312aa9 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -32,7 +32,7 @@ group :development, :test do <%- end -%> # Access an IRB console on exception pages or by using <%%= console %> in views - gem 'web-console', '~> 2.0.0.beta4' + gem 'web-console', '~> 2.0' <%- if spring_install? %> # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' -- cgit v1.2.3 From 75eacb00e0a5b23dca4f067dacafecddcb41b04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 25 Nov 2014 22:34:10 -0200 Subject: Use jquery-rails 4.0.0 --- railties/lib/rails/generators/app_base.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index be79f37e94..0823b0cc46 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -276,14 +276,8 @@ module Rails [] else gems = [coffee_gemfile_entry, javascript_runtime_gemfile_entry] - - if options[:javascript] == 'jquery' - gems << GemfileEntry.version('jquery-rails', '~> 4.0.0.beta2', - 'Use jQuery as the JavaScript library') - else - gems << GemfileEntry.version("#{options[:javascript]}-rails", nil, - "Use #{options[:javascript]} as the JavaScript library") - end + gems << GemfileEntry.version("#{options[:javascript]}-rails", nil, + "Use #{options[:javascript]} as the JavaScript library") unless options[:skip_turbolinks] gems << GemfileEntry.version("turbolinks", nil, -- cgit v1.2.3 From f2b17231bacbbc437f64b51b386b3eea06c65c84 Mon Sep 17 00:00:00 2001 From: Alexander Mankuta Date: Wed, 26 Nov 2014 13:47:09 +0200 Subject: Use absolute_path of caller_locations to infer engine root According to documentation `path` only returns file names. On MRI it's not the case but it's likely a bug in MRI. --- railties/lib/rails/engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 023ea98145..4b7da32208 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -351,7 +351,7 @@ module Rails base.called_from = begin call_stack = if Kernel.respond_to?(:caller_locations) - caller_locations.map(&:path) + caller_locations.map(&:absolute_path) else # Remove the line number from backtraces making sure we don't leave anything behind caller.map { |p| p.sub(/:\d+.*/, '') } -- cgit v1.2.3 From 3766015f07c026e1a22d1b7732f52d25d8b8d6c5 Mon Sep 17 00:00:00 2001 From: Juan Ignacio Pumarino Date: Wed, 26 Nov 2014 10:36:54 -0300 Subject: Provide support for SQL Server connections with dbconsole using sqsh --- railties/lib/rails/commands/dbconsole.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/commands/dbconsole.rb b/railties/lib/rails/commands/dbconsole.rb index 1a2613a8d0..b01cdce6ea 100644 --- a/railties/lib/rails/commands/dbconsole.rb +++ b/railties/lib/rails/commands/dbconsole.rb @@ -74,6 +74,21 @@ module Rails find_cmd_and_exec('sqlplus', logon) + when "sqlserver" + args = [] + + args += ["-D", "#{config['database']}"] if config['database'] + args += ["-U", "#{config['username']}"] if config['username'] + args += ["-P", "#{config['password']}"] if config['password'] + + if config['host'] + host_arg = "#{config['host']}" + host_arg << ":#{config['port']}" if config['port'] + args += ["-S", host_arg] + end + + find_cmd_and_exec("sqsh", *args) + else abort "Unknown command-line client for #{config['database']}. Submit a Rails patch to add support!" end -- cgit v1.2.3 From 2a4e14db981e38611667d407a975600ee720ada7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 26 Nov 2014 16:17:51 -0200 Subject: Test against rack master --- railties/lib/rails/generators/app_base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 0823b0cc46..b410363f2f 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -195,9 +195,9 @@ module Rails def rails_gemfile_entry if options.dev? - [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH)] + [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH), GemfileEntry.github('rack', 'rack/rack')] elsif options.edge? - [GemfileEntry.github('rails', 'rails/rails')] + [GemfileEntry.github('rails', 'rails/rails'), GemfileEntry.github('rack', 'rack/rack')] else [GemfileEntry.version('rails', Rails::VERSION::STRING, -- cgit v1.2.3 From 4eefa1a0ac098c0391f305323fb1cf1c7495c907 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 27 Nov 2014 00:45:16 -0800 Subject: rails -> bin/rails in index.html --- railties/lib/rails/templates/rails/welcome/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/templates/rails/welcome/index.html.erb b/railties/lib/rails/templates/rails/welcome/index.html.erb index 89792066d5..6726c23fc9 100644 --- a/railties/lib/rails/templates/rails/welcome/index.html.erb +++ b/railties/lib/rails/templates/rails/welcome/index.html.erb @@ -237,7 +237,7 @@
  1. -

    Use rails generate to create your models and controllers

    +

    Use bin/rails generate to create your models and controllers

    To see all available options, run it without parameters.

  2. -- cgit v1.2.3 From 31815d7167404557524712c665dda83505c094be Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 27 Nov 2014 16:53:27 -0200 Subject: Revert "Test against rack master" This reverts commit 2a4e14db981e38611667d407a975600ee720ada7. --- railties/lib/rails/generators/app_base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index b410363f2f..0823b0cc46 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -195,9 +195,9 @@ module Rails def rails_gemfile_entry if options.dev? - [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH), GemfileEntry.github('rack', 'rack/rack')] + [GemfileEntry.path('rails', Rails::Generators::RAILS_DEV_PATH)] elsif options.edge? - [GemfileEntry.github('rails', 'rails/rails'), GemfileEntry.github('rack', 'rack/rack')] + [GemfileEntry.github('rails', 'rails/rails')] else [GemfileEntry.version('rails', Rails::VERSION::STRING, -- cgit v1.2.3 From 6c83d4bfd5e33bde5d659fcbe6f28bfe80d8eb4a Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Fri, 28 Nov 2014 11:03:52 +0100 Subject: docs, AR no longer makes use of `test:prepare`. [ci skip] Change originated from https://github.com/rails/rails/pull/17739#issuecomment-64829088 /cc @metaskills --- railties/lib/rails/test_unit/testing.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 0d0cfa3c6b..254ea9ecf6 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -10,7 +10,8 @@ end namespace :test do task :prepare do - # Placeholder task for other Railtie and plugins to enhance. See Active Record for an example. + # Placeholder task for other Railtie and plugins to enhance. + # If used with Active Record, this task runs before the database schema is synchronized. end Rails::TestTask.new(:run) do |t| -- cgit v1.2.3 From f25ad07f5ade46eb978fa82658463232d0247c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 28 Nov 2014 15:00:06 -0200 Subject: Start Rails 5 development :tada: We will support only Ruby >= 2.1. But right now we don't accept pull requests with syntax changes to drop support to Ruby 1.9. --- railties/lib/rails/gem_version.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/gem_version.rb b/railties/lib/rails/gem_version.rb index 8abed99f2c..7d74b1bfe5 100644 --- a/railties/lib/rails/gem_version.rb +++ b/railties/lib/rails/gem_version.rb @@ -5,10 +5,10 @@ module Rails end module VERSION - MAJOR = 4 - MINOR = 2 + MAJOR = 5 + MINOR = 0 TINY = 0 - PRE = "beta4" + PRE = "alpha" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end -- cgit v1.2.3 From c6bd5284b3d0771e8b8790e5f5a03d21428c99e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 28 Nov 2014 15:14:35 -0200 Subject: We don't need to use sass-rails 5.0.0.beta --- railties/lib/rails/generators/app_base.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index 0823b0cc46..f5ae600bd8 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -240,8 +240,7 @@ module Rails gems << GemfileEntry.github('sass-rails', 'rails/sass-rails', 'Use SCSS for stylesheets') else - gems << GemfileEntry.version('sass-rails', - '~> 5.0.0.beta1', + gems << GemfileEntry.version('sass-rails', '~> 4.0', 'Use SCSS for stylesheets') end -- cgit v1.2.3 From 96d0f751f97c7eebc63d02b5dab88eee3aa3a921 Mon Sep 17 00:00:00 2001 From: claudiob Date: Fri, 28 Nov 2014 18:04:19 -0800 Subject: Bump required Ruby version to 2.1.0 [This article](http://weblog.rubyonrails.org/2014/8/20/Rails-4-2-beta1/#maintenance-consequences-and-rails-5-0) states that: > Rails 5.0 is in most likelihood going to target Ruby 2.2. Before the exact minimum version is fully decided, @arthurnn [suggests](https://github.com/rails/rails/pull/17830#issuecomment-64940383) that **at least** version 2.1.0 **must** be required by the `gemspec` files. --- railties/lib/rails/ruby_version_check.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/ruby_version_check.rb b/railties/lib/rails/ruby_version_check.rb index df74643a59..edfe5cb786 100644 --- a/railties/lib/rails/ruby_version_check.rb +++ b/railties/lib/rails/ruby_version_check.rb @@ -1,13 +1,13 @@ -if RUBY_VERSION < '1.9.3' +if RUBY_VERSION < '2.1.0' desc = defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE})" abort <<-end_message - Rails 4 prefers to run on Ruby 2.1 or newer. + Rails 5 requires to run on Ruby 2.1 or newer. You're running #{desc} - Please upgrade to Ruby 1.9.3 or newer to continue. + Please upgrade to Ruby 2.1.0 or newer to continue. end_message end -- cgit v1.2.3 From 56e47cf66d2e3009b4032d0cd2ceb1a6e5e42573 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 29 Nov 2014 08:47:54 +0100 Subject: adds missing period in test.rb [ci skip] --- .../rails/generators/rails/app/templates/config/environments/test.rb.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 32756eb88b..03a3568fbe 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -31,7 +31,7 @@ Rails.application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Randomize the order test cases are executed + # Randomize the order test cases are executed. config.active_support.test_order = :random # Print deprecation notices to the stderr. -- cgit v1.2.3 From d1374f99bf3090f3e659687c112ed0c5c0865cfb Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Mon, 27 Oct 2014 17:28:53 +0100 Subject: Pass symbol as an argument instead of a block --- railties/lib/rails/application/routes_reloader.rb | 4 +--- railties/lib/rails/commands/plugin.rb | 2 +- railties/lib/rails/generators.rb | 4 ++-- railties/lib/rails/generators/actions.rb | 2 +- railties/lib/rails/generators/base.rb | 2 +- railties/lib/rails/generators/named_base.rb | 4 ++-- railties/lib/rails/generators/rails/app/app_generator.rb | 4 +--- railties/lib/rails/generators/resource_helpers.rb | 4 ++-- railties/lib/rails/info.rb | 4 ++-- railties/lib/rails/paths.rb | 10 +++++----- 10 files changed, 18 insertions(+), 22 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index 737977adf9..cf0a4e128f 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -41,9 +41,7 @@ module Rails end def finalize! - route_sets.each do |routes| - routes.finalize! - end + route_sets.each(&:finalize!) end def revert diff --git a/railties/lib/rails/commands/plugin.rb b/railties/lib/rails/commands/plugin.rb index 95bbdd4cdf..52d8966ead 100644 --- a/railties/lib/rails/commands/plugin.rb +++ b/railties/lib/rails/commands/plugin.rb @@ -11,7 +11,7 @@ else end if File.exist?(railsrc) extra_args_string = File.read(railsrc) - extra_args = extra_args_string.split(/\n+/).flat_map {|l| l.split} + extra_args = extra_args_string.split(/\n+/).flat_map(&:split) puts "Using #{extra_args.join(" ")} from #{railsrc}" ARGV.insert(1, *extra_args) end diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index bf2390cb7e..e25c364178 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -153,7 +153,7 @@ module Rails def self.invoke(namespace, args=ARGV, config={}) names = namespace.to_s.split(':') if klass = find_by_namespace(names.pop, names.any? && names.join(':')) - args << "--help" if args.empty? && klass.arguments.any? { |a| a.required? } + args << "--help" if args.empty? && klass.arguments.any?(&:required?) klass.start(args, config) else options = sorted_groups.map(&:last).flatten @@ -226,7 +226,7 @@ module Rails def self.public_namespaces lookup! - subclasses.map { |k| k.namespace } + subclasses.map(&:namespace) end def self.print_generators diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index ffdb314612..5373121835 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -189,7 +189,7 @@ module Rails # generate(:authenticated, "user session") def generate(what, *args) log :generate, what - argument = args.flat_map {|arg| arg.to_s }.join(" ") + argument = args.flat_map(&:to_s).join(" ") in_root { run_ruby_script("bin/rails generate #{what} #{argument}", verbose: false) } end diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 9af6435f23..813b8b629e 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -273,7 +273,7 @@ module Rails # Use Rails default banner. def self.banner - "rails generate #{namespace.sub(/^rails:/,'')} #{self.arguments.map{ |a| a.usage }.join(' ')} [options]".gsub(/\s+/, ' ') + "rails generate #{namespace.sub(/^rails:/,'')} #{self.arguments.map(&:usage).join(' ')} [options]".gsub(/\s+/, ' ') end # Sets the base_name taking into account the current class namespace. diff --git a/railties/lib/rails/generators/named_base.rb b/railties/lib/rails/generators/named_base.rb index b7da44ca2d..397e1e73f1 100644 --- a/railties/lib/rails/generators/named_base.rb +++ b/railties/lib/rails/generators/named_base.rb @@ -99,7 +99,7 @@ module Rails end def class_name - (class_path + [file_name]).map!{ |m| m.camelize }.join('::') + (class_path + [file_name]).map!(&:camelize).join('::') end def human_name @@ -156,7 +156,7 @@ module Rails def assign_names!(name) #:nodoc: @class_path = name.include?('/') ? name.split('/') : name.split('::') - @class_path.map! { |m| m.underscore } + @class_path.map!(&:underscore) @file_name = @class_path.pop end diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 9110c129d1..f8a8ae90d9 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -260,9 +260,7 @@ module Rails public_task :generate_spring_binstubs def run_after_bundle_callbacks - @after_bundle_callbacks.each do |callback| - callback.call - end + @after_bundle_callbacks.each(&:call) end protected diff --git a/railties/lib/rails/generators/resource_helpers.rb b/railties/lib/rails/generators/resource_helpers.rb index 4669935156..3f84d76ae0 100644 --- a/railties/lib/rails/generators/resource_helpers.rb +++ b/railties/lib/rails/generators/resource_helpers.rb @@ -39,7 +39,7 @@ module Rails def assign_controller_names!(name) @controller_name = name @controller_class_path = name.include?('/') ? name.split('/') : name.split('::') - @controller_class_path.map! { |m| m.underscore } + @controller_class_path.map!(&:underscore) @controller_file_name = @controller_class_path.pop end @@ -48,7 +48,7 @@ module Rails end def controller_class_name - (controller_class_path + [controller_file_name]).map!{ |m| m.camelize }.join('::') + (controller_class_path + [controller_file_name]).map!(&:camelize).join('::') end def controller_i18n_scope diff --git a/railties/lib/rails/info.rb b/railties/lib/rails/info.rb index 94ede76932..5909446b66 100644 --- a/railties/lib/rails/info.rb +++ b/railties/lib/rails/info.rb @@ -8,7 +8,7 @@ module Rails mattr_accessor :properties class << (@@properties = []) def names - map {|val| val.first } + map(&:first) end def value_for(property_name) @@ -26,7 +26,7 @@ module Rails end def to_s - column_width = properties.names.map {|name| name.length}.max + column_width = properties.names.map(&:length).max info = properties.map do |name, value| value = value.join(", ") if value.is_a?(Array) "%-#{column_width}s %s" % [name, value] diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index d11804af17..5458036219 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -77,23 +77,23 @@ module Rails end def all_paths - values.tap { |v| v.uniq! } + values.tap(&:uniq!) end def autoload_once - filter_by { |p| p.autoload_once? } + filter_by(&:autoload_once?) end def eager_load - filter_by { |p| p.eager_load? } + filter_by(&:eager_load?) end def autoload_paths - filter_by { |p| p.autoload? } + filter_by(&:autoload?) end def load_paths - filter_by { |p| p.load_path? } + filter_by(&:load_path?) end private -- cgit v1.2.3