Class: Appraisal::Matrix::RubygemsHelper
- Inherits:
-
Object
- Object
- Appraisal::Matrix::RubygemsHelper
- Defined in:
- lib/appraisal/matrix/rubygems_helper.rb
Class Method Summary collapse
-
.versions_to_test(gem_name, version_requirement, step) ⇒ Set
Returns a set of versions to test against for a given gem.
Class Method Details
.versions_to_test(gem_name, version_requirement, step) ⇒ Set
Returns a set of versions to test against for a given gem.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/appraisal/matrix/rubygems_helper.rb', line 17 def versions_to_test(gem_name, version_requirement, step) # Generate a set to store the versions to test against versions_to_test = Set.new # Load versions from rubygems api URI.parse("https://rubygems.org/api/v1/versions/#{gem_name}.json").open do |raw_version_data| JSON.parse(raw_version_data.read).each do |version_data| version = Gem::Version.new(version_data['number']) versions_to_test << version_for_step(version, step) if include_version?(version, version_requirement) end end versions_to_test end |