From 756c1c897df30d9dfd6ea2489e4ba95981e2ff7e Mon Sep 17 00:00:00 2001 From: John Keiser Date: Wed, 24 Aug 2016 10:40:52 -0700 Subject: [PATCH] Allow JSON 2.0 on Ruby 2.2 and above --- Gemfile | 5 +++++ train.gemspec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 5f52e817..165a9038 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,11 @@ if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.9.3') gem 'net-ssh', '~> 2.9' end +if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2') + gem 'json', '< 2.0' + gem 'rack', '< 2.0' +end + group :test do gem 'bundler', '~> 1.11' gem 'minitest', '~> 5.8' diff --git a/train.gemspec b/train.gemspec index df839993..5c7b9fc4 100644 --- a/train.gemspec +++ b/train.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_dependency 'json', '~> 1.8' + spec.add_dependency 'json', '>= 1.8', '< 3.0' # chef-client < 12.4.1 require mixlib-shellout-2.0.1 spec.add_dependency 'mixlib-shellout', '~> 2.0' # net-ssh 3.x drops Ruby 1.9 support, so this constraint could be raised when