Sha256: 086a5fcad606979f5e36d0c5d551f58085b604b4789fafe975aefb386ebe6bec
Contents?: true
Size: 602 Bytes
Versions: 11
Compression:
Stored size: 602 Bytes
Contents
# frozen_string_literal: true module Getv class Package # Getv::Package::Gem class class Gem < Package def initialize(name, opts = {}) opts = defaults.merge(opts) opts = { gem: name[/ruby(gem)?-(.*)/, 2] || name }.merge(opts) super name, opts end private def retrieve_versions require 'json' retries ||= 0 JSON.parse(get("https://rubygems.org/api/v1/versions/#{opts[:gem]}.json")).map do |v| v['number'] end rescue StandardError retry if (retries += 1) < 4 end end end end
Version data entries
11 entries across 11 versions & 2 rubygems