Commit 7c85e481 authored by Sruthi Chandran's avatar Sruthi Chandran

New upstream version 5.2.2+dfsg

parent a6e15468
# Don't put *.swp, *.bak, etc here; those belong in a global ~/.gitignore.
# Don't put *.swp, *.bak, etc here; those belong in a global .gitignore.
# Check out https://help.github.com/articles/ignoring-files for how to set that up.
.Gemfile
.ruby-version
.byebug_history
debug.log
pkg
.ruby-version
/*/doc/
/*/test/tmp/
/.bundle
/dist
/doc/rdoc
/*/doc
/*/test/tmp
/activerecord/sqlnet.log
/activemodel/test/fixtures/fixture_database.sqlite3
/activesupport/test/fixtures/isolation_test
/activestorage/test/service/configurations.yml
/railties/test/500.html
/railties/test/fixtures/tmp
/railties/test/initializer/root/log
/railties/doc
/railties/tmp
/guides/output
/dist/
/doc/
/guides/output/
debug.log
node_modules/
/actionview/log
package-lock.json
pkg/
......@@ -61,35 +61,35 @@ env:
- "GEM=ac:integration"
rvm:
- 2.2.8
- 2.3.5
- 2.4.2
- 2.5.0
- 2.2.10
- 2.3.7
- 2.4.4
- 2.5.1
- ruby-head
matrix:
include:
- rvm: 2.5.0
- rvm: 2.5.1
env: "GEM=av:ujs"
- rvm: 2.2.8
- rvm: 2.2.10
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: 2.3.5
- rvm: 2.3.7
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: 2.4.2
- rvm: 2.4.4
env: "GEM=aj:integration"
services:
- memcached
- redis-server
- rabbitmq
- rvm: 2.5.0
- rvm: 2.5.1
env: "GEM=aj:integration"
services:
- memcached
......@@ -101,15 +101,15 @@ matrix:
- memcached
- redis-server
- rabbitmq
- rvm: 2.3.5
- rvm: 2.3.7
env:
- "GEM=ar:mysql2 MYSQL=mariadb"
addons:
mariadb: 10.2
- rvm: 2.3.5
- rvm: 2.3.7
env:
- "GEM=ar:sqlite3_mem"
- rvm: 2.3.5
- rvm: 2.3.7
env:
- "GEM=ar:postgresql POSTGRES=9.2"
addons:
......@@ -123,6 +123,8 @@ matrix:
env:
- "GEM=am,amo,aj"
allow_failures:
- rvm: 2.2.10
env: "GEM=guides"
- rvm: ruby-head
- rvm: jruby-9.1.15.0
- env: "GEM=ac:integration"
......
tap "homebrew/core"
tap "homebrew/bundle"
tap "homebrew/services"
tap "caskroom/cask"
brew "ffmpeg"
brew "memcached"
brew "mysql"
brew "postgresql"
brew "redis"
brew "yarn"
cask "xquartz"
brew "mupdf"
brew "poppler"
......@@ -13,7 +13,11 @@ gem "rake", ">= 11.1"
# be loaded after loading the test library.
gem "mocha", require: false
gem "capybara", ">= 2.15", "< 4.0"
if RUBY_VERSION < "2.3"
gem "capybara", ">= 2.15", "< 3.2"
else
gem "capybara", ">= 2.15"
end
gem "rack-cache", "~> 1.2"
gem "coffee-rails"
......@@ -38,7 +42,7 @@ gem "rubocop", ">= 0.47", require: false
gem "rb-inotify", github: "matthewd/rb-inotify", branch: "close-handling", require: false
# https://github.com/puma/puma/pull/1345
gem "stopgap_13632", platforms: :mri if RUBY_VERSION == "2.2.8"
gem "stopgap_13632", github: "pixeltrix/stopgap_13632", platforms: :mri if RUBY_VERSION < "2.3"
group :doc do
gem "sdoc", "~> 1.0"
......@@ -48,7 +52,7 @@ group :doc do
end
# Active Support.
gem "dalli", ">= 2.2.1", "< 2.7.7"
gem "dalli", ">= 2.2.1"
gem "listen", ">= 3.0.5", "< 3.2", require: false
gem "libxml-ruby", platforms: :ruby
gem "connection_pool", require: false
......
This diff is collapsed.
/lib/assets/compiled
/tmp
/lib/assets/compiled/
/tmp/
## Rails 5.2.2 (December 04, 2018) ##
* No changes.
## Rails 5.2.1.1 (November 27, 2018) ##
* No changes.
## Rails 5.2.1 (August 07, 2018) ##
* No changes.
## Rails 5.2.0 (April 09, 2018) ##
* Removed deprecated evented redis adapter.
......
......@@ -9,7 +9,7 @@ module Broadcasting
delegate :broadcasting_for, to: :class
class_methods do
module ClassMethods
# Broadcast a hash to a unique broadcasting for this <tt>model</tt> in this channel.
def broadcast_to(model, message)
ActionCable.server.broadcast(broadcasting_for([ channel_name, model ]), message)
......
......@@ -13,7 +13,7 @@ module Callbacks
define_callbacks :unsubscribe
end
class_methods do
module ClassMethods
def before_subscribe(*methods, &block)
set_callback(:subscribe, :before, *methods, &block)
end
......
......@@ -5,7 +5,7 @@ module Channel
module Naming
extend ActiveSupport::Concern
class_methods do
module ClassMethods
# Returns the name of the channel, underscored, without the <tt>Channel</tt> ending.
# If the channel is in a namespace, then the namespaces are represented by single
# colon separators in the channel name.
......
......@@ -11,7 +11,7 @@ module Identification
class_attribute :identifiers, default: Set.new
end
class_methods do
module ClassMethods
# Mark a key as being a connection identifier index that can then be used to find the specific connection again later.
# Common identifiers are current_user and current_account, but could be anything, really.
#
......
......@@ -9,7 +9,7 @@ def self.gem_version
module VERSION
MAJOR = 5
MINOR = 2
TINY = 0
TINY = 2
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
{
"name": "actioncable",
"version": "5.2.0",
"version": "5.2.2",
"description": "WebSocket framework for Ruby on Rails.",
"main": "lib/assets/compiled/action_cable.js",
"files": [
......
## Rails 5.2.2 (December 04, 2018) ##
* No changes.
## Rails 5.2.1.1 (November 27, 2018) ##
* No changes.
## Rails 5.2.1 (August 07, 2018) ##
* Ensure mail gem is eager autoloaded when eager load is true to prevent thread deadlocks.
*Samuel Cochran*
## Rails 5.2.0 (April 09, 2018) ##
* Bring back proc with arity of 1 in `ActionMailer::Base.default` proc
......
......@@ -52,6 +52,13 @@ module ActionMailer
autoload :TestHelper
autoload :MessageDelivery
autoload :DeliveryJob
def self.eager_load!
super
require "mail"
Mail.eager_autoload!
end
end
autoload :Mime, "action_dispatch/http/mime_type"
......
......@@ -9,7 +9,7 @@ def self.gem_version
module VERSION
MAJOR = 5
MINOR = 2
TINY = 0
TINY = 2
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
......@@ -60,7 +60,7 @@ def assert_emails(number)
#
# Note: This assertion is simply a shortcut for:
#
# assert_emails 0
# assert_emails 0, &block
def assert_no_emails(&block)
assert_emails 0, &block
end
......@@ -93,20 +93,7 @@ def assert_enqueued_emails(number, &block)
assert_enqueued_jobs number, only: [ ActionMailer::DeliveryJob, ActionMailer::Parameterized::DeliveryJob ], &block
end
# Asserts that a specific email has been enqueued, optionally
# matching arguments.
#
# def test_email
# ContactMailer.welcome.deliver_later
# assert_enqueued_email_with ContactMailer, :welcome
# end
#
# def test_email_with_arguments
# ContactMailer.welcome("Hello", "Goodbye").deliver_later
# assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"]
# end
#
# If a block is passed, that block should cause the specified email
# Asserts that block should cause the specified email
# to be enqueued.
#
# def test_email_in_block
......@@ -115,7 +102,7 @@ def assert_enqueued_emails(number, &block)
# end
# end
#
# If `args` is provided as a Hash, a parameterized email is matched.
# If +args+ is provided as a Hash, a parameterized email is matched.
#
# def test_parameterized_email
# assert_enqueued_email_with ContactMailer, :welcome,
......
......@@ -152,9 +152,9 @@ class BaseTest < ActiveSupport::TestCase
assert_equal(2, email.parts.length)
assert_equal("multipart/mixed", email.mime_type)
assert_equal("text/html", email.parts[0].mime_type)
assert_equal("Attachment with content", email.parts[0].body.encoded)
assert_equal("Attachment with content", email.parts[0].decoded)
assert_equal("application/pdf", email.parts[1].mime_type)
assert_equal("VGhpcyBpcyB0ZXN0IEZpbGUgY29udGVudA==\r\n", email.parts[1].body.encoded)
assert_equal("This is test File content", email.parts[1].decoded)
end
test "adds the given :body as part" do
......@@ -162,9 +162,9 @@ class BaseTest < ActiveSupport::TestCase
assert_equal(2, email.parts.length)
assert_equal("multipart/mixed", email.mime_type)
assert_equal("text/plain", email.parts[0].mime_type)
assert_equal("I'm the eggman", email.parts[0].body.encoded)
assert_equal("I'm the eggman", email.parts[0].decoded)
assert_equal("application/pdf", email.parts[1].mime_type)
assert_equal("VGhpcyBpcyB0ZXN0IEZpbGUgY29udGVudA==\r\n", email.parts[1].body.encoded)
assert_equal("This is test File content", email.parts[1].decoded)
end
test "can embed an inline attachment" do
......
## Rails 5.2.2 (December 04, 2018) ##
* Reset Capybara sessions if failed system test screenshot raising an exception.
Reset Capybara sessions if `take_failed_screenshot` raise exception
in system test `after_teardown`.
*Maxim Perepelitsa*
* Use request object for context if there's no controller
There is no controller instance when using a redirect route or a
mounted rack application so pass the request object as the context
when resolving dynamic CSP sources in this scenario.
Fixes #34200.
*Andrew White*
* Apply mapping to symbols returned from dynamic CSP sources
Previously if a dynamic source returned a symbol such as :self it
would be converted to a string implicity, e.g:
policy.default_src -> { :self }
would generate the header:
Content-Security-Policy: default-src self
and now it generates:
Content-Security-Policy: default-src 'self'
*Andrew White*
* Fix `rails routes -c` for controller name consists of multiple word.
*Yoshiyuki Kinjo*
* Call the `#redirect_to` block in controller context.
*Steven Peckins*
## Rails 5.2.1.1 (November 27, 2018) ##
* No changes.
## Rails 5.2.1 (August 07, 2018) ##
* Prevent `?null=` being passed on JSON encoded test requests.
`RequestEncoder#encode_params` won't attempt to parse params if
there are none.
So call like this will no longer append a `?null=` query param.
get foos_url, as: :json
*Alireza Bashiri*
* Ensure `ActionController::Parameters#transform_values` and
`ActionController::Parameters#transform_values!` converts hashes into
parameters.
*Kevin Sjöberg*
* Fix strong parameters `permit!` with nested arrays.
Given:
```
params = ActionController::Parameters.new(nested_arrays: [[{ x: 2, y: 3 }, { x: 21, y: 42 }]])
params.permit!
```
`params[:nested_arrays][0][0].permitted?` will now return `true` instead of `false`.
*Steve Hull*
* Reset `RAW_POST_DATA` and `CONTENT_LENGTH` request environment between test requests in
`ActionController::TestCase` subclasses.
*Eugene Kenny*
* Output only one Content-Security-Policy nonce header value per request.
Fixes #32597.
*Andrey Novikov*, *Andrew White*
* Only disable GPUs for headless Chrome on Windows.
It is not necessary anymore for Linux and macOS machines.
https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1
*Stefan Wrobel*
* Fix system tests transactions not closed between examples.
*Sergey Tarasov*
## Rails 5.2.0 (April 09, 2018) ##
* Check exclude before flagging cookies as secure.
......
......@@ -7,6 +7,7 @@
module AbstractController
extend ActiveSupport::Autoload
autoload :ActionNotFound, "abstract_controller/base"
autoload :Base
autoload :Caching
autoload :Callbacks
......
......@@ -105,7 +105,7 @@ def _compute_redirect_to_location(request, options) #:nodoc:
when String
request.protocol + request.host_with_port + options
when Proc
_compute_redirect_to_location request, options.call
_compute_redirect_to_location request, instance_eval(&options)
else
url_for(options)
end.delete("\0\r\n")
......
......@@ -418,7 +418,7 @@ def protect_against_forgery? # :doc:
NULL_ORIGIN_MESSAGE = <<-MSG.strip_heredoc
The browser returned a 'null' origin for a request with origin-based forgery protection turned on. This usually
means you have the 'no-referrer' Referrer-Policy header enabled, or that you the request came from a site that
means you have the 'no-referrer' Referrer-Policy header enabled, or that the request came from a site that
refused to give its origin. This makes it impossible for Rails to verify the source of the requests. Likely the
best solution is to change your referrer policy to something less strict like same-origin or strict-same-origin.
If you cannot change the referrer policy, you can disable origin checking with the
......
......@@ -375,7 +375,7 @@ def permitted?
# Person.new(params) # => #<Person id: nil, name: "Francesco">
def permit!
each_pair do |key, value|
Array.wrap(value).each do |v|
Array.wrap(value).flatten.each do |v|
v.permit! if v.respond_to? :permit!
end
end
......@@ -561,12 +561,14 @@ def []=(key, value)
# Returns a parameter for the given +key+. If the +key+
# can't be found, there are several options: With no other arguments,
# it will raise an <tt>ActionController::ParameterMissing</tt> error;
# if more arguments are given, then that will be returned; if a block
# if a second argument is given, then that is returned (converted to an
# instance of ActionController::Parameters if possible); if a block
# is given, then that will be run and its result returned.
#
# params = ActionController::Parameters.new(person: { name: "Francesco" })
# params.fetch(:person) # => <ActionController::Parameters {"name"=>"Francesco"} permitted: false>
# params.fetch(:none) # => ActionController::ParameterMissing: param is missing or the value is empty: none
# params.fetch(:none, {}) # => <ActionController::Parameters {} permitted: false>
# params.fetch(:none, "Francesco") # => "Francesco"
# params.fetch(:none) { "Francesco" } # => "Francesco"
def fetch(key, *args)
......@@ -592,7 +594,8 @@ def fetch(key, *args)
# params2 = ActionController::Parameters.new(foo: [10, 11, 12])
# params2.dig(:foo, 1) # => 11
def dig(*keys)
convert_value_to_parameters(@parameters.dig(*keys))
convert_hashes_to_parameters(keys.first, @parameters[keys.first])
@parameters.dig(*keys)
end
end
......@@ -639,20 +642,18 @@ def extract!(*keys)
# params = ActionController::Parameters.new(a: 1, b: 2, c: 3)
# params.transform_values { |x| x * 2 }
# # => <ActionController::Parameters {"a"=>2, "b"=>4, "c"=>6} permitted: false>
def transform_values(&block)
if block
new_instance_with_inherited_permitted_status(
@parameters.transform_values(&block)
)
else
@parameters.transform_values
end
def transform_values
return to_enum(:transform_values) unless block_given?
new_instance_with_inherited_permitted_status(
@parameters.transform_values { |v| yield convert_value_to_parameters(v) }
)
end
# Performs values transformation and returns the altered
# <tt>ActionController::Parameters</tt> instance.
def transform_values!(&block)
@parameters.transform_values!(&block)
def transform_values!
return to_enum(:transform_values!) unless block_given?
@parameters.transform_values! { |v| yield convert_value_to_parameters(v) }
self
end
......
......@@ -460,10 +460,6 @@ def head(action, **args)
def process(action, method: "GET", params: {}, session: nil, body: nil, flash: {}, format: nil, xhr: false, as: nil)
check_required_ivars