Skip to content

Commit

Permalink
Travis 3.0 (ohler55#639)
Browse files Browse the repository at this point in the history
Add Ruby 3.0.0 to travis.
  • Loading branch information
ohler55 authored Jan 24, 2021
1 parent 6786984 commit c16576e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ rvm:
- 2.4.10
- 2.5.8
- 2.6.6
- 2.7.1
- 2.7.2
- 3.0.0
#- ruby-head

gemfile:
- gemfiles/no_rails.gemfile
Expand All @@ -22,6 +24,9 @@ gemfile:
matrix:
fast_finish: true

allow_failures:
- rvm: 3.0.0

exclude:
- gemfile: gemfiles/no_rails.gemfile
rvm: 2.4.10
Expand All @@ -38,4 +43,4 @@ matrix:
- os: osx
rvm: 2.4.10
- os: osx
rvm: 2.5.8
rvm: 3.0.0
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 3.11.1 - 2020-01-24

- XrXr fixed Ruby 3.0.0 object movement issue.

## 3.11.0 - 2020-01-12

- Added `:compat_bigdecimal` to support the JSON gem `:decimal_class` undocumented option.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [![{}j](http://www.ohler.com/dev/images/oj_comet_64.svg)](http://www.ohler.com/oj) gem

[![Build Status](https://img.shields.io/travis/ohler55/oj/master.svg?logo=travis)](http://travis-ci.org/ohler55/oj?branch=master) [![AppVeyor](https://img.shields.io/appveyor/ci/ohler55/oj/master.svg?logo=appveyor)](https://ci.appveyor.com/project/ohler55/oj) ![Gem](https://img.shields.io/gem/v/oj.svg) ![Gem](https://img.shields.io/gem/dt/oj.svg) [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=oj&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=oj&package-manager=bundler&version-scheme=semver) [![TideLift](https://tidelift.com/badges/github/ohler55/oj)](https://tidelift.com/subscription/pkg/rubygems-oj?utm_source=rubygems-oj&utm_medium=referral&utm_campaign=readme)
[![Build Status](https://img.shields.io/travis/ohler55/oj/master.svg?logo=travis)](http://travis-ci.org/ohler55/oj?branch=master) ![Gem](https://img.shields.io/gem/v/oj.svg) ![Gem](https://img.shields.io/gem/dt/oj.svg) [![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=oj&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=oj&package-manager=bundler&version-scheme=semver) [![TideLift](https://tidelift.com/badges/github/ohler55/oj)](https://tidelift.com/subscription/pkg/rubygems-oj?utm_source=rubygems-oj&utm_medium=referral&utm_campaign=readme)

A *fast* JSON parser and Object marshaller as a Ruby gem.

Expand Down
2 changes: 1 addition & 1 deletion lib/oj/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

module Oj
# Current version of the module.
VERSION = '3.11.0'
VERSION = '3.11.1'
end
18 changes: 15 additions & 3 deletions test/json_gem/json_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ def test_states

def test_pretty_state
state = JSON::PRETTY_STATE_PROTOTYPE.dup
# In come cases in Ruby 3.0 an :escape_slash is included in the state. It
# seems to occur on travis but not locally.
actual = state.to_h
actual.delete(:escape_slash)
assert_equal({
:allow_nan => false,
:array_nl => "\n",
Expand All @@ -147,11 +151,15 @@ def test_pretty_state
:object_nl => "\n",
:space => " ",
:space_before => "",
}.sort_by { |n,| n.to_s }, state.to_h.sort_by { |n,| n.to_s })
}.sort_by { |n,| n.to_s }, actual.sort_by { |n,| n.to_s })
end

def test_safe_state
state = JSON::SAFE_STATE_PROTOTYPE.dup
# In come cases in Ruby 3.0 an :escape_slash is included in the state. It
# seems to occur on travis but not locally.
actual = state.to_h
actual.delete(:escape_slash)
assert_equal({
:allow_nan => false,
:array_nl => "",
Expand All @@ -163,11 +171,15 @@ def test_safe_state
:object_nl => "",
:space => "",
:space_before => "",
}.sort_by { |n,| n.to_s }, state.to_h.sort_by { |n,| n.to_s })
}.sort_by { |n,| n.to_s }, actual.sort_by { |n,| n.to_s })
end

def test_fast_state
state = JSON::FAST_STATE_PROTOTYPE.dup
# In come cases in Ruby 3.0 an :escape_slash is included in the state. It
# seems to occur on travis but not locally.
actual = state.to_h
actual.delete(:escape_slash)
assert_equal({
:allow_nan => false,
:array_nl => "",
Expand All @@ -179,7 +191,7 @@ def test_fast_state
:object_nl => "",
:space => "",
:space_before => "",
}.sort_by { |n,| n.to_s }, state.to_h.sort_by { |n,| n.to_s })
}.sort_by { |n,| n.to_s }, actual.sort_by { |n,| n.to_s })
end

def test_allow_nan
Expand Down

0 comments on commit c16576e

Please sign in to comment.