Class: Spandx::Ruby::Gateway
Overview
Instance Attribute Summary
#http
Instance Method Summary
collapse
#initialize
#all, #inherited, #registry
Instance Method Details
#each ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/spandx/ruby/gateway.rb', line 7
def each
response = http.get('https://index.rubygems.org/versions')
return unless http.ok?(response)
parse_each_from(StringIO.new(response.body)) do |item|
yield item
end
end
|
#licenses(name, version) ⇒ Object
20
21
22
|
# File 'lib/spandx/ruby/gateway.rb', line 20
def licenses(name, version)
details_on(name, version)['licenses'] || []
end
|
#licenses_for(dependency) ⇒ Object
16
17
18
|
# File 'lib/spandx/ruby/gateway.rb', line 16
def licenses_for(dependency)
licenses(dependency.name, dependency.version)
end
|
#matches?(dependency) ⇒ Boolean
24
25
26
|
# File 'lib/spandx/ruby/gateway.rb', line 24
def matches?(dependency)
dependency.package_manager == :rubygems
end
|