Class: LicenseFinder::BundlerPackage

Inherits:
Package
  • Object
show all
Defined in:
lib/license_finder/packages/bundler_package.rb

Instance Attribute Summary

Attributes inherited from Package

#authors, #children, #description, #groups, #homepage, #install_path, #license_names_from_spec, #logger, #manual_approval, #name, #parents, #summary, #version

Instance Method Summary collapse

Methods inherited from Package

#<=>, #activations, #approved?, #approved_manually!, #approved_manually?, #decide_on_license, #eql?, #hash, #license_files, license_names_from_standard_spec, #licenses, #licenses_from_spec, #licensing, #log_activation, #missing?, #notice_files, #permitted!, #permitted?, #restricted!, #restricted?

Constructor Details

#initialize(spec, bundler_def, options = {}) ⇒ BundlerPackage

Returns a new instance of BundlerPackage.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/license_finder/packages/bundler_package.rb', line 5

def initialize(spec, bundler_def, options = {})
  children = spec.dependencies.map(&:name)
  groups = Array(bundler_def && bundler_def.groups).map(&:to_s)

  super(
    spec.name,
    spec.version.to_s,
    options.merge(
      authors: Array(spec.authors).join(', '),
      summary: spec.summary,
      description: spec.description,
      homepage: spec.homepage,
      children: children,
      groups: groups,
      spec_licenses: spec.licenses,
      install_path: spec.full_gem_path
    )
  )
end

Instance Method Details

#package_managerObject



25
26
27
# File 'lib/license_finder/packages/bundler_package.rb', line 25

def package_manager
  'Bundler'
end

#package_urlObject



29
30
31
# File 'lib/license_finder/packages/bundler_package.rb', line 29

def package_url
  "https://rubygems.org/gems/#{CGI.escape(name)}/versions/#{CGI.escape(version)}"
end