Module: Geminabox::RubygemsDependency

Defined in:
lib/geminabox/rubygems_dependency.rb

Class Method Summary collapse

Class Method Details

.for(*gems) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/geminabox/rubygems_dependency.rb', line 8

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

.rubygems_uriObject


22
23
24
# File 'lib/geminabox/rubygems_dependency.rb', line 22

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