after_2_0_0 = [ '~> 2.0.2' ] before_2_4_0 = [ '< 1.8.5' ] before_2_2_0 = [ '~> 1.7.7', '~> 1.6.8', '~> 1.5.5' ] json_gems = [] json_gems += after_2_0_0 if RUBY_VERSION >= '2.0.0' json_gems += before_2_4_0 if RUBY_VERSION < '2.4.0' json_gems += before_2_2_0 if RUBY_VERSION < '2.2.0' if RUBY_ENGINE == "jruby" json_gems.delete('~> 1.2.4') json_gems.delete('~> 1.1.9') end json_gems.each do |version| gemfile <<-RB gem 'rack' gem 'json', '#{version}' RB end # vim: ft=ruby