Sha256: f50d362855c777d29d3827d9f30f1989162dae29541248bbdfcdc2ce26b665f7

Contents?: true

Size: 829 Bytes

Versions: 4

Compression:

Stored size: 829 Bytes

Contents

require_relative "gem_specs/downloader"
require_relative "gem_specs/parser"
require_relative "gem_specs/specs"

module Artifactory
  module GemImport
    module GemSpecs
      module_function

      def missing_gems(source_repo:, target_repo:, only: /.+/)
        source_specs = get repo: source_repo, only: only
        target_specs = get repo: target_repo, only: only

        source_specs - target_specs
      end

      def get(repo:, only: /.+/)
        specs = Specs
          .new(url: repo.specs_url, headers: repo.headers)
          .specs
      rescue Net::HTTPClientException, Net::HTTPFatalError, Net::OpenTimeout, SocketError => err
        raise ClientError, "Could not fetch specs. URL: #{repo.specs_url}, Reason: #{err.message}"
      else
        Specs.filter(specs, only: only).sort
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
artifactory-gem_import-0.2.2 lib/artifactory/gem_import/gem_specs.rb
artifactory-gem_import-0.2.0 lib/artifactory/gem_import/gem_specs.rb
artifactory-gem_import-0.1.4 lib/artifactory/gem_import/gem_specs.rb
artifactory-gem_import-0.1.3 lib/artifactory/gem_import/gem_specs.rb