New upstream version 4.2.9

parent c56d62c6
language: ruby
sudo: false
script: 'ci/travis.rb'
#FIXME: Remove bundler uninstall on Travis when https://github.com/bundler/bundler/issues/4493 is fixed.
before_install:
- rvm @global do gem uninstall bundler --all --ignore-dependencies --executables
- rvm @global do gem install bundler -v '1.11.2'
- bundle --version
- "rvm current | grep 'jruby' && export AR_JDBC=true || echo"
- "rm ${BUNDLE_GEMFILE}.lock"
- "gem update bundler"
before_script:
- bundle update
cache: bundler
......@@ -18,6 +15,7 @@ env:
- "GEM=railties"
- "GEM=ap"
- "GEM=am,amo,as,av,aj"
- "GEM=as PRESERVE_TIMEZONES=1"
- "GEM=ar:mysql"
- "GEM=ar:mysql2"
- "GEM=ar:sqlite3"
......@@ -25,21 +23,22 @@ env:
- "GEM=aj:integration"
rvm:
- 1.9.3
- 2.0.0
- 2.1
- 2.2.4
- 2.3.0
- ruby-head
- 2.0.0-p648
- 2.1.10
- 2.2.7
- 2.3.4
- 2.4.1
matrix:
allow_failures:
- rvm: ruby-head
- rvm: 1.9.3
env: "GEM=ar:mysql"
- rvm: 2.0.0
env: "GEM=ar:mysql"
- rvm: ruby-head
env: "GEM=ar:mysql"
- env: "GEM=aj:integration"
exclude:
- rvm: 2.4.1
env: "GEM=ar:mysql"
fast_finish: true
notifications:
email: false
......@@ -53,7 +52,7 @@ notifications:
on_failure: always
rooms:
- secure: "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="
bundler_args: --without test --jobs 3 --retry 3
bundler_args: --jobs 3 --retry 3
services:
- memcached
- redis
......
source 'https://rubygems.org'
ruby "~> #{RUBY_VERSION}" if ENV["TRAVIS"]
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
gemspec
# We need a newish Rake since Active Job sets its test tasks' descriptions.
......@@ -31,9 +38,9 @@ gem 'uglifier', '>= 1.3.0', require: false
gem 'mime-types', '< 3', require: false
group :doc do
gem 'sdoc', '~> 0.4.0'
gem 'sdoc', '>= 1.0.0.rc1', '< 1.1'
gem 'redcarpet', '~> 3.1.2', platforms: :ruby
gem 'w3c_validators'
gem 'w3c_validators', RUBY_VERSION < '2.0' ? '1.2' : nil
gem 'kindlerb', '0.1.1'
gem 'mustache', '~> 0.99.8'
end
......@@ -45,11 +52,11 @@ gem 'dalli', '>= 2.2.1'
group :job do
gem 'resque', require: false
gem 'resque-scheduler', require: false
gem 'sidekiq', require: false
gem 'sidekiq', RUBY_VERSION < '2.2' ? '< 5' : nil, require: false
gem 'sucker_punch', '< 2.0', require: false
gem 'delayed_job', require: false
gem 'queue_classic', require: false, platforms: :ruby
gem 'sneakers', '0.1.1.pre', require: false
gem 'sneakers', '< 2.0.0', require: false
gem 'que', require: false
gem 'backburner', require: false
gem 'qu-rails', github: "bkeepers/qu", branch: "master", require: false
......@@ -83,7 +90,7 @@ group :test do
end
platforms :ruby do
gem 'nokogiri', '>= 1.4.5'
gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
# Needed for compiling the ActionDispatch::Journey parser
gem 'racc', '>=1.4.6', require: false
......@@ -93,13 +100,17 @@ platforms :ruby do
group :db do
gem 'pg', '>= 0.15.0'
gem 'mysql', '>= 2.9.0'
gem 'mysql2', '>= 0.4.0'
end
end
platforms :mri_19, :mri_20, :mri_21, :mri_22, :mri_23 do
group :db do
gem 'mysql', '>= 2.9.0'
end
end
platforms :jruby do
gem 'json'
if ENV['AR_JDBC']
gem 'activerecord-jdbcsqlite3-adapter', github: 'jruby/activerecord-jdbc-adapter', branch: 'master'
group :db do
......
GIT
remote: git://github.com/bkeepers/qu.git
remote: https://github.com/bkeepers/qu.git
revision: d098e2657c92e89a6413bebd9c033930759c061f
branch: master
specs:
......@@ -14,55 +14,54 @@ GIT
PATH
remote: .
specs:
actionmailer (4.2.7)
actionpack (= 4.2.7)
actionview (= 4.2.7)
activejob (= 4.2.7)
actionmailer (4.2.9)
actionpack (= 4.2.9)
actionview (= 4.2.9)
activejob (= 4.2.9)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7)
actionview (= 4.2.7)
activesupport (= 4.2.7)
actionpack (4.2.9)
actionview (= 4.2.9)
activesupport (= 4.2.9)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7)
activesupport (= 4.2.7)
actionview (4.2.9)
activesupport (= 4.2.9)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7)
activesupport (= 4.2.7)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.9)
activesupport (= 4.2.9)
globalid (>= 0.3.0)
activemodel (4.2.7)
activesupport (= 4.2.7)
activemodel (4.2.9)
activesupport (= 4.2.9)
builder (~> 3.1)
activerecord (4.2.7)
activemodel (= 4.2.7)
activesupport (= 4.2.7)
activerecord (4.2.9)
activemodel (= 4.2.9)
activesupport (= 4.2.9)
arel (~> 6.0)
activesupport (4.2.7)
activesupport (4.2.9)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
rails (4.2.7)
actionmailer (= 4.2.7)
actionpack (= 4.2.7)
actionview (= 4.2.7)
activejob (= 4.2.7)
activemodel (= 4.2.7)
activerecord (= 4.2.7)
activesupport (= 4.2.7)
rails (4.2.9)
actionmailer (= 4.2.9)
actionpack (= 4.2.9)
actionview (= 4.2.9)
activejob (= 4.2.9)
activemodel (= 4.2.9)
activerecord (= 4.2.9)
activesupport (= 4.2.9)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.7)
railties (= 4.2.9)
sprockets-rails
railties (4.2.7)
actionpack (= 4.2.7)
activesupport (= 4.2.7)
railties (4.2.9)
actionpack (= 4.2.9)
activesupport (= 4.2.9)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
......@@ -70,17 +69,18 @@ GEM
remote: https://rubygems.org/
specs:
amq-protocol (1.9.2)
arel (6.0.3)
backburner (1.3.0)
arel (6.0.4)
backburner (1.4.1)
beaneater (~> 1.0)
concurrent-ruby (~> 1.0.1)
dante (> 0.1.5)
bcrypt (3.1.11)
bcrypt (3.1.11-x64-mingw32)
bcrypt (3.1.11-x86-mingw32)
beaneater (1.0.0)
benchmark-ips (2.6.1)
builder (3.2.2)
bunny (1.1.9)
benchmark-ips (2.7.2)
builder (3.2.3)
bunny (2.0.0)
amq-protocol (>= 1.9.2)
celluloid (0.17.3)
celluloid-essentials
......@@ -97,7 +97,7 @@ GEM
timers (>= 4.1.1)
celluloid-pool (0.20.5)
timers (>= 4.1.1)
celluloid-supervision (0.20.5)
celluloid-supervision (0.20.6)
timers (>= 4.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
......@@ -105,38 +105,40 @@ GEM
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
connection_pool (2.2.0)
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
connection_pool (2.2.1)
dalli (2.7.6)
dante (0.2.0)
delayed_job (4.1.2)
activesupport (>= 3.0, < 5.1)
delayed_job_active_record (4.1.1)
activerecord (>= 3.0, < 5.1)
delayed_job (4.1.3)
activesupport (>= 3.0, < 5.2)
delayed_job_active_record (4.1.2)
activerecord (>= 3.0, < 5.2)
delayed_job (>= 3.0, < 5)
erubis (2.7.0)
et-orbi (1.0.4)
tzinfo
execjs (2.4.0)
globalid (0.3.6)
activesupport (>= 4.1.0)
hitimes (1.2.4)
hitimes (1.2.4-x86-mingw32)
i18n (0.7.0)
jquery-rails (4.1.1)
globalid (0.4.0)
activesupport (>= 4.2.0)
hitimes (1.2.5)
hitimes (1.2.5-x86-mingw32)
i18n (0.8.4)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
json (2.1.0)
kindlerb (0.1.1)
mustache
nokogiri
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mail (2.6.6)
mime-types (>= 1.16, < 4)
metaclass (0.0.4)
mime-types (2.99.1)
mini_portile2 (2.0.0)
mime-types (2.99.3)
mini_portile2 (2.2.0)
minitest (5.3.3)
mocha (0.14.0)
metaclass (~> 0.0.1)
......@@ -144,21 +146,21 @@ GEM
multi_json (1.12.1)
mustache (0.99.8)
mysql (2.9.1)
mysql2 (0.4.4)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
nokogiri (1.6.7.2-x64-mingw32)
mini_portile2 (~> 2.0.0.rc2)
nokogiri (1.6.7.2-x86-mingw32)
mini_portile2 (~> 2.0.0.rc2)
mysql2 (0.4.6)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
nokogiri (1.8.0-x64-mingw32)
mini_portile2 (~> 2.2.0)
nokogiri (1.8.0-x86-mingw32)
mini_portile2 (~> 2.2.0)
pg (0.18.4)
psych (2.0.17)
que (0.11.5)
psych (2.2.4)
que (0.13.0)
queue_classic (3.1.0)
pg (>= 0.17, < 0.19)
racc (1.4.14)
rack (1.6.4)
rack-cache (1.6.1)
rack (1.6.8)
rack-cache (1.7.0)
rack (>= 0.4)
rack-protection (1.5.3)
rack
......@@ -166,79 +168,80 @@ GEM
rack (>= 1.0)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
rails-dom-testing (1.0.8)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rake (11.1.2)
rdoc (4.2.2)
json (~> 1.4)
rake (12.0.0)
rdoc (5.1.0)
redcarpet (3.1.2)
redis (3.3.0)
redis-namespace (1.5.2)
redis (3.3.3)
redis-namespace (1.5.3)
redis (~> 3.0, >= 3.0.4)
resque (1.26.0)
resque (1.27.4)
mono_logger (~> 1.0)
multi_json (~> 1.0)
redis-namespace (~> 1.3)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
resque-scheduler (4.2.0)
resque-scheduler (4.3.0)
mono_logger (~> 1.0)
redis (~> 3.0)
resque (~> 1.25)
redis (~> 3.3)
resque (~> 1.26)
rufus-scheduler (~> 3.2)
ruby-prof (0.11.3)
rufus-scheduler (3.2.1)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
sequel (4.34.0)
serverengine (1.6.3)
rufus-scheduler (3.4.2)
et-orbi (~> 1.0)
sdoc (1.0.0.rc2)
rdoc (~> 5.0)
sequel (4.47.0)
serverengine (1.5.11)
sigdump (~> 0.2.2)
sidekiq (4.1.2)
sidekiq (5.0.2)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
redis (~> 3.2, >= 3.2.1)
rack-protection (>= 1.5.0)
redis (~> 3.3, >= 3.3.3)
sigdump (0.2.4)
sinatra (1.4.7)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sneakers (0.1.1.pre)
bunny (~> 1.1.3)
serverengine
sneakers (1.1.2)
bunny (>= 1.7.0, <= 2.0.0)
serverengine (~> 1.5.5)
thor
thread
thread (~> 0.1.7)
sprockets (3.0.3)
rack (~> 1.0)
sprockets-rails (3.1.1)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
stackprof (0.2.9)
sqlite3 (1.3.13)
stackprof (0.2.10)
sucker_punch (1.6.0)
celluloid (~> 0.17.2)
thor (0.19.1)
thread (0.2.2)
thread_safe (0.3.5)
tilt (2.0.4)
timers (4.1.1)
thor (0.19.4)
thread (0.1.7)
thread_safe (0.3.6)
tilt (2.0.7)
timers (4.1.2)
hitimes
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.3)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.0.0)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
vegas (0.1.11)
rack (>= 1.0.0)
w3c_validators (1.2)
json
nokogiri
w3c_validators (1.3.2)
json (>= 1.8)
nokogiri (~> 1.6)
PLATFORMS
ruby
......@@ -259,7 +262,6 @@ DEPENDENCIES
delayed_job_active_record
execjs (< 2.5)
jquery-rails (~> 4.0)
json
kindlerb (= 0.1.1)
mime-types (< 3)
minitest (< 5.3.4)
......@@ -267,7 +269,7 @@ DEPENDENCIES
mustache (~> 0.99.8)
mysql (>= 2.9.0)
mysql2 (>= 0.4.0)
nokogiri (>= 1.4.5)
nokogiri (>= 1.7)
pg (>= 0.15.0)
psych (~> 2.0)
qu-rails!
......@@ -282,10 +284,10 @@ DEPENDENCIES
resque
resque-scheduler
ruby-prof (~> 0.11.2)
sdoc (~> 0.4.0)
sdoc (>= 1.0.0.rc1, < 1.1)
sequel
sidekiq
sneakers (= 0.1.1.pre)
sneakers (< 2.0.0)
sprockets (~> 3.0.0.rc.1)
sqlite3 (~> 1.3.6)
stackprof
......@@ -295,4 +297,4 @@ DEPENDENCIES
w3c_validators
BUNDLED WITH
1.12.5
1.15.1
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
## Rails 4.2.8 (February 21, 2017) ##
* No changes.
## Rails 4.2.7 (July 12, 2016) ##
* Removes `-t` from default Sendmail arguments to match the underlying
......
......@@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 7
PRE = "1"
TINY = 9
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
......
## Rails 4.2.9 (June 26, 2017) ##
* Use more specific check for :format in route path
The current check for whether to add an optional format to the path is very lax
and will match things like `:format_id` where there are nested resources, e.g:
``` ruby
resources :formats do
resources :items
end
```
Fix this by using a more restrictive regex pattern that looks for the patterns
`(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
allow for multiple closing parenthesis since the route may be of this form:
``` ruby
get "/books(/:action(.:format))", controller: "books"
```
This probably isn't what's intended since it means that the default index action
route doesn't support a format but we have a test for it so we need to allow it.
Fixes #28517.
*Andrew White*
## Rails 4.2.8 (February 21, 2017) ##
* No changes.
## Rails 4.2.7 (July 12, 2016) ##
* No changes.
......
......@@ -85,8 +85,6 @@ def self._render_with_renderer_method_name(key)
# format.csv { render csv: @csvable, filename: @csvable.name }
# end
# end
# To use renderers and their mime types in more concise ways, see
# <tt>ActionController::MimeResponds::ClassMethods.respond_to</tt>
def self.add(key, &block)
define_method(_render_with_renderer_method_name(key), &block)
RENDERERS << key.to_sym
......
......@@ -13,11 +13,13 @@ class Utils # :nodoc:
# normalize_path("") # => "/"
# normalize_path("/%ab") # => "/%AB"
def self.normalize_path(path)
encoding = path.encoding
path = "/#{path}"
path.squeeze!('/')
path.sub!(%r{/+\Z}, '')
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
path = '/' if path == ''
path = "/" if path == "".freeze
path.force_encoding(encoding)
path
end
......
......@@ -311,7 +311,7 @@ def []=(name, options)
handle_options(options)
if @cookies[name.to_s] != value or options[:expires]
if @cookies[name.to_s] != value || options[:expires]
@cookies[name.to_s] = value
@set_cookies[name.to_s] = options
@delete_cookies.delete(name.to_s)
......@@ -506,7 +506,7 @@ def initialize(parent_jar, key_generator, options = {})
@parent_jar = parent_jar
@options = options
secret = key_generator.generate_key(@options[:encrypted_cookie_salt])
secret = key_generator.generate_key(@options[:encrypted_cookie_salt])[0, ActiveSupport::MessageEncryptor.key_len]
sign_secret = key_generator.generate_key(@options[:encrypted_signed_cookie_salt])
@encryptor = ActiveSupport::MessageEncryptor.new(secret, sign_secret, digest: digest, serializer: ActiveSupport::MessageEncryptor::NullSerializer)
end
......
......@@ -60,6 +60,7 @@ def constraint_args(constraint, request)
class Mapping #:nodoc:
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
OPTIONAL_FORMAT_REGEX = %r{(?:\(\.:format\)+|\.:format|/)\Z}
attr_reader :requirements, :conditions, :defaults
attr_reader :to, :default_controller, :default_action, :as, :anchor
......@@ -110,7 +111,7 @@ def initialize(scope, set, path, defaults, as, options)
if options_constraints.is_a?(Hash)
split_constraints path_params, options_constraints
options_constraints.each do |key, default|
if URL_OPTIONS.include?(key) && (String === default || Fixnum === default)
if URL_OPTIONS.include?(key) && (String === default || Integer === default)
@defaults[key] ||= default
end
end
......@@ -144,7 +145,7 @@ def normalize_path!(path, format)
end
def optional_format?(path, format)
format != false && !path.include?(':format') && !path.end_with?('/')
format != false && path !~ OPTIONAL_FORMAT_REGEX
end
def normalize_options!(options, formatted, path_params, path_ast, modyoule)
......@@ -790,8 +791,8 @@ def scope(*args)
end
if options[:constraints].is_a?(Hash)
defaults = options[:constraints].select do
|k, v| URL_OPTIONS.include?(k) && (v.is_a?(String) || v.is_a?(Fixnum))
defaults = options[:constraints].select do |k, v|
URL_OPTIONS.include?(k) && (v.is_a?(String) || v.is_a?(Integer))
end
(options[:defaults] ||= {}).reverse_merge!(defaults)
......
......@@ -361,6 +361,7 @@ def remove! # :nodoc:
# simultaneously.
def open_session
dup.tap do |session|
session.reset!
yield session if block_given?
end
end
......
......@@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 7
PRE = "1"
TINY = 9
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
......
......@@ -25,7 +25,7 @@ def test_assert_response_predicate_methods
end
end
def test_assert_response_fixnum
def test_assert_response_integer
@response = FakeResponse.new 400
assert_response 400
......
......@@ -428,6 +428,14 @@ def test_request_with_bad_format
end
end
test "creation of multiple integration sessions" do
integration_session # initialize first session
a = open_session