Sha256: 5c42af08bc7c1669dc268c3009aa50eb0fbbc73386f22a22edf2c33c311f6ab9

Contents?: true

Size: 576 Bytes

Versions: 8

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

require 'json'
require 'uri'

module Geminabox
  module RubygemsDependency

    class << self

      def for(*gems)

        url = [
          rubygems_uri,
          '?gems=',
          gems.map(&:to_s).join(',')
        ].join
        body = Geminabox.http_adapter.get_content(url)
        Marshal.load(body)
      rescue Exception => e
        return [] if Geminabox.allow_remote_failure
        raise e
      end

      def rubygems_uri
        URI.join(Geminabox.bundler_ruby_gems_url, '/api/v1/dependencies')
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
geminabox-2.1.0 lib/geminabox/rubygems_dependency.rb
geminabox-2.1.0.rc.1 lib/geminabox/rubygems_dependency.rb
geminabox-2.0.0 lib/geminabox/rubygems_dependency.rb
geminabox-2.0.0.rc.1 lib/geminabox/rubygems_dependency.rb
geminabox-1.5.0 lib/geminabox/rubygems_dependency.rb
geminabox-1.5.0.rc.1 lib/geminabox/rubygems_dependency.rb
geminabox-1.4.3 lib/geminabox/rubygems_dependency.rb
geminabox-1.4.3.rc lib/geminabox/rubygems_dependency.rb