mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Merge pull request #2071 from rails-api/fix_ci
Nokogiri 1.7 removes support for Rubies < 2.1
This commit is contained in:
commit
c2565ed726
45
.travis.yml
45
.travis.yml
@ -1,28 +1,55 @@
|
|||||||
language: ruby
|
language: ruby
|
||||||
|
|
||||||
rvm:
|
|
||||||
- 1.9.3
|
|
||||||
- 2.0.0
|
|
||||||
- 2.1.1
|
|
||||||
- ruby-head
|
|
||||||
- jruby-19mode
|
|
||||||
- rbx-2
|
|
||||||
- ruby-head
|
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
rvm:
|
||||||
|
- 1.9.3 # EOL
|
||||||
|
- 2.0.0 # EOL
|
||||||
|
- 2.1
|
||||||
|
- ruby-head
|
||||||
|
- jruby-9.1.5.0 # is precompiled per http://rubies.travis-ci.org/
|
||||||
|
|
||||||
|
jdk:
|
||||||
|
- oraclejdk8
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- gem update --system
|
||||||
|
- rvm @global do gem uninstall bundler -a -x
|
||||||
|
- rvm @global do gem install bundler -v 1.13.7
|
||||||
install: bundle install --path=vendor/bundle --retry=3 --jobs=3
|
install: bundle install --path=vendor/bundle --retry=3 --jobs=3
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- vendor/bundle
|
- vendor/bundle
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
global:
|
||||||
|
- "JRUBY_OPTS='--dev -J-Xmx1024M --debug'"
|
||||||
|
matrix:
|
||||||
- "RAILS_VERSION=4.0"
|
- "RAILS_VERSION=4.0"
|
||||||
- "RAILS_VERSION=4.1"
|
- "RAILS_VERSION=4.1"
|
||||||
- "RAILS_VERSION=4.2"
|
- "RAILS_VERSION=4.2"
|
||||||
|
- "RAILS_VERSION=5.0"
|
||||||
- "RAILS_VERSION=master"
|
- "RAILS_VERSION=master"
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
exclude:
|
||||||
|
- rvm: 1.9.3
|
||||||
|
env: RAILS_VERSION=master
|
||||||
|
- rvm: 2.0.0
|
||||||
|
env: RAILS_VERSION=master
|
||||||
|
- rvm: 2.1
|
||||||
|
env: RAILS_VERSION=master
|
||||||
|
- rvm: jruby-9.1.5.0
|
||||||
|
env: RAILS_VERSION=master
|
||||||
|
- rvm: 1.9.3
|
||||||
|
env: RAILS_VERSION=5.0
|
||||||
|
- rvm: 2.0.0
|
||||||
|
env: RAILS_VERSION=5.0
|
||||||
|
- rvm: 2.1
|
||||||
|
env: RAILS_VERSION=5.0
|
||||||
|
- rvm: jruby-9.1.5.0
|
||||||
|
env: RAILS_VERSION=5.0
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rvm: ruby-head
|
- rvm: ruby-head
|
||||||
- env: "RAILS_VERSION=master"
|
- env: "RAILS_VERSION=master"
|
||||||
|
fast_finish: true
|
||||||
|
|||||||
15
Gemfile
15
Gemfile
@ -6,11 +6,14 @@ version = ENV["RAILS_VERSION"] || "4.2"
|
|||||||
|
|
||||||
if version == 'master'
|
if version == 'master'
|
||||||
gem 'rack', github: 'rack/rack'
|
gem 'rack', github: 'rack/rack'
|
||||||
|
gem 'arel', github: 'rails/arel'
|
||||||
|
gem 'rails', github: 'rails/rails'
|
||||||
git 'https://github.com/rails/rails.git' do
|
git 'https://github.com/rails/rails.git' do
|
||||||
gem 'railties'
|
gem 'railties'
|
||||||
gem 'activesupport'
|
gem 'activesupport'
|
||||||
gem 'activemodel'
|
gem 'activemodel'
|
||||||
gem 'actionpack'
|
gem 'actionpack'
|
||||||
|
gem 'activerecord', group: :test
|
||||||
# Rails 5
|
# Rails 5
|
||||||
gem 'actionview'
|
gem 'actionview'
|
||||||
end
|
end
|
||||||
@ -18,28 +21,34 @@ if version == 'master'
|
|||||||
gem 'rails-controller-testing', github: 'rails/rails-controller-testing'
|
gem 'rails-controller-testing', github: 'rails/rails-controller-testing'
|
||||||
else
|
else
|
||||||
gem_version = "~> #{version}.0"
|
gem_version = "~> #{version}.0"
|
||||||
|
gem 'rails', gem_version
|
||||||
gem 'railties', gem_version
|
gem 'railties', gem_version
|
||||||
gem 'activesupport', gem_version
|
gem 'activesupport', gem_version
|
||||||
gem 'activemodel', gem_version
|
gem 'activemodel', gem_version
|
||||||
gem 'actionpack', gem_version
|
gem 'actionpack', gem_version
|
||||||
|
gem 'activerecord', gem_version, group: :test
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_VERSION < '2'
|
if RUBY_VERSION < '2'
|
||||||
gem 'mime-types', [ '>= 2.6.2', '< 3' ]
|
gem 'mime-types', [ '>= 2.6.2', '< 3' ]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if RUBY_VERSION < '2.1'
|
||||||
|
gem 'nokogiri', '< 1.7'
|
||||||
|
end
|
||||||
|
|
||||||
# https://github.com/bundler/bundler/blob/89a8778c19269561926cea172acdcda241d26d23/lib/bundler/dependency.rb#L30-L54
|
# https://github.com/bundler/bundler/blob/89a8778c19269561926cea172acdcda241d26d23/lib/bundler/dependency.rb#L30-L54
|
||||||
@windows_platforms = [:mswin, :mingw, :x64_mingw]
|
@windows_platforms = [:mswin, :mingw, :x64_mingw]
|
||||||
|
|
||||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
gem 'tzinfo-data', platforms: (@windows_platforms + [:jruby])
|
tzinfo_platforms = @windows_platforms
|
||||||
|
tzinfo_platforms += [:jruby] if version >= '4.1'
|
||||||
|
gem 'tzinfo-data', platforms: tzinfo_platforms
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'activerecord'
|
|
||||||
gem 'sqlite3', platform: (@windows_platforms + [:ruby])
|
gem 'sqlite3', platform: (@windows_platforms + [:ruby])
|
||||||
gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
|
gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
|
||||||
|
|
||||||
gem 'codeclimate-test-reporter', require: false
|
|
||||||
gem 'simplecov', '~> 0.10', require: false, group: :development
|
gem 'simplecov', '~> 0.10', require: false, group: :development
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -203,7 +203,7 @@ end
|
|||||||
if included_associations.include? name
|
if included_associations.include? name
|
||||||
association_serializer = build_serializer(association)
|
association_serializer = build_serializer(association)
|
||||||
# we must do this always because even if the current association is not
|
# we must do this always because even if the current association is not
|
||||||
# embeded in root, it might have its own associations that are embeded in root
|
# embedded in root, it might have its own associations that are embedded in root
|
||||||
hash.merge!(association_serializer.embedded_in_root_associations) do |key, oldval, newval|
|
hash.merge!(association_serializer.embedded_in_root_associations) do |key, oldval, newval|
|
||||||
if oldval.respond_to?(:to_ary)
|
if oldval.respond_to?(:to_ary)
|
||||||
[oldval, newval].flatten.uniq
|
[oldval, newval].flatten.uniq
|
||||||
|
|||||||
2
test/fixtures/poro.rb
vendored
2
test/fixtures/poro.rb
vendored
@ -49,7 +49,7 @@ end
|
|||||||
|
|
||||||
class SpecialPost < Post
|
class SpecialPost < Post
|
||||||
def special_comment
|
def special_comment
|
||||||
@speical_comment ||= Comment.new(content: 'special')
|
@special_comment ||= Comment.new(content: 'special')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user