diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 10 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/app_base.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/Gemfile | 2 | ||||
-rw-r--r-- | railties/lib/rails/paths.rb | 18 |
5 files changed, 20 insertions, 13 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 7df517de71..cc21213f1c 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -88,9 +88,10 @@ module Rails end def threadsafe! - ActiveSupport::Deprecation.warn "config.threadsafe! is deprecated. Rails applications " \ - "behave by default as thread safe in production as long as config.cache_classes and " \ - "config.eager_load are set to true" + message = "config.threadsafe! is deprecated. Rails applications " \ + "behave by default as thread safe in production as long as config.cache_classes and " \ + "config.eager_load are set to true" + ActiveSupport::Deprecation.warn message @cache_classes = true @eager_load = true self @@ -141,8 +142,7 @@ module Rails end def whiny_nils=(*) - ActiveSupport::Deprecation.warn "config.whiny_nils option " \ - "is deprecated and no longer works", caller + ActiveSupport::Deprecation.warn "config.whiny_nils option is deprecated and no longer works" end end end diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index c520f7af9d..2d87b8594a 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -99,6 +99,7 @@ module Rails initializer :activate_queue_consumer do |app| if config.queue.class == ActiveSupport::Queue app.queue_consumer = config.queue_consumer || config.queue.consumer + app.queue_consumer.logger ||= Rails.logger if app.queue_consumer.respond_to?(:logger=) app.queue_consumer.start at_exit { app.queue_consumer.shutdown } end diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index e761e26b04..de3127f43e 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -209,7 +209,7 @@ module Rails # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sprockets-rails', github: 'rails/sprockets-rails' + gem 'sprockets-rails', '~> 2.0.0.rc1' gem 'sass-rails', '~> 4.0.0.beta' gem 'coffee-rails', '~> 4.0.0.beta' diff --git a/railties/lib/rails/generators/rails/app/templates/Gemfile b/railties/lib/rails/generators/rails/app/templates/Gemfile index 30f8a5f75e..5b7a653a09 100644 --- a/railties/lib/rails/generators/rails/app/templates/Gemfile +++ b/railties/lib/rails/generators/rails/app/templates/Gemfile @@ -7,7 +7,7 @@ source 'https://rubygems.org' <%= "gem 'jruby-openssl'\n" if defined?(JRUBY_VERSION) -%> <%= assets_gemfile_entry %> -<%= javascript_gemfile_entry %> +<%= javascript_gemfile_entry -%> # To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 8af4130e87..cfdb15a14e 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -99,14 +99,15 @@ module Rails protected def filter_by(constraint) - all = [] + yes = [] + no = [] + all_paths.each do |path| - if path.send(constraint) - paths = path.existent - paths -= path.children.map { |p| p.send(constraint) ? [] : p.existent }.flatten - all.concat(paths) - end + paths = path.existent + path.existent_base_paths + path.send(constraint) ? yes.concat(paths) : no.concat(paths) end + + all = yes - no all.uniq! all end @@ -134,6 +135,7 @@ module Rails keys.delete(@current) @root.values_at(*keys.sort) end + deprecate :children def first expanded.first @@ -210,6 +212,10 @@ module Rails expanded.select { |d| File.directory?(d) } end + def existent_base_paths + map { |p| File.expand_path(p, @root.path) }.select{ |f| File.exist? f } + end + alias to_a expanded end end |