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

Version Path
getv-rs-2.3.5 lib/getv/package/gem.rb
getv-rs-2.3.4 lib/getv/package/gem.rb
getv-rs-2.3.3 lib/getv/package/gem.rb
getv-rs-2.3.2 lib/getv/package/gem.rb
getv-rs-2.3.1 lib/getv/package/gem.rb
getv-rs-2.3.0 lib/getv/package/gem.rb
getv-2.2.2 lib/getv/package/gem.rb
getv-2.2.0 lib/getv/package/gem.rb
getv-2.1.4 lib/getv/package/gem.rb
getv-2.1.3 lib/getv/package/gem.rb
getv-2.1.2 lib/getv/package/gem.rb