Module: Geminabox::RubygemsDependency

Defined in:
lib/geminabox/rubygems_dependency.rb

Class Method Summary collapse

Class Method Details

.for(*gems) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/geminabox/rubygems_dependency.rb', line 11

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

.rubygems_uriObject



25
26
27
# File 'lib/geminabox/rubygems_dependency.rb', line 25

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