flexirest.gemspec in flexirest-1.3.22 vs flexirest.gemspec in flexirest-1.3.24
- old
+ new
@@ -30,8 +30,19 @@
spec.add_development_dependency "api-auth", ">= 1.3.1"
spec.add_development_dependency 'typhoeus'
spec.add_runtime_dependency "multi_json"
spec.add_runtime_dependency "crack"
- spec.add_runtime_dependency "activesupport"
spec.add_runtime_dependency "faraday"
+
+ # Use Gem::Version to parse the Ruby version for reliable comparison
+ # ActiveSupport 5+ requires Ruby 2.2.2
+ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.2.2')
+ spec.add_runtime_dependency "activesupport"
+ else
+ spec.add_runtime_dependency "activesupport", "< 5.0.0"
+ end
+ # JSON is an implicit dependency of something, but JSON v2+ requires Ruby 2+
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
+ spec.add_runtime_dependency "json", "< 2.0.0"
+ end
end