Skip to content

Commit

Permalink
Relax json dependency to support Ruby 2.4.0-dev
Browse files Browse the repository at this point in the history
Ruby 2.4.0+ requires a newer version of the `json` gem which is incompatible with pre-2.0.0 versions (i.e. 1.9.3, which the gem supports). This changes the gemspec to be able to handle both cases. Tests pass with both versions of the dependency to there's no problem.

This PR also allows `rbx` to fail builds - apparently it's broken in Travis at the moment (see <vmg/redcarpet#580>).

Fixes #260.
  • Loading branch information
Tim Rogers committed Oct 18, 2016
1 parent e546c71 commit e21754b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -7,9 +7,13 @@ rvm:
- 2.3.1
- jruby-19mode
- rbx-2
- ruby-2.4.0-preview2
gemfile:
- Gemfile.travis
script:
- bundle exec rubocop
- bundle exec rspec spec
sudo: false
matrix:
allow_failures:
- rvm: rbx-2
10 changes: 9 additions & 1 deletion restforce.gemspec
Expand Up @@ -20,7 +20,15 @@ Gem::Specification.new do |gem|

gem.add_dependency 'faraday', '~> 0.9.0'
gem.add_dependency 'faraday_middleware', '>= 0.8.8'
gem.add_dependency 'json', ['>= 1.7.5', '< 1.9.0']

# Ruby 2.4 requires JSON 2.0, but that doesn't work with old pre-2.0.0 versions of Ruby.
# See https://github.com/ejholmes/restforce/issues/260.
if RUBY_VERSION =~ /^1.9/
gem.add_dependency 'json', ['>= 1.7.5', '< 1.9.0']
else
gem.add_dependency 'json', '>= 2.0.0'
end

gem.add_dependency 'hashie', ['>= 1.2.0', '< 4.0']

gem.add_development_dependency 'rspec', '~> 2.14.0'
Expand Down

0 comments on commit e21754b

Please sign in to comment.