Sha256: 1dfcb5c7769f63bdcb0a721593d9b918847df9525df3127d73fd935fb6c5df1d

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

require 'json'

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)
        JSON.parse(body)
      rescue Exception => e
        return [] if Geminabox.allow_remote_failure
        raise e
      end

      def rubygems_uri
        "https://bundler.rubygems.org/api/v1/dependencies.json"
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
geminabox-0.13.0 lib/geminabox/rubygems_dependency.rb
r5_geminabox-0.0.1 lib/geminabox/rubygems_dependency.rb
geminabox-0.12.4 lib/geminabox/rubygems_dependency.rb