Class: LicenseFinder::CondaPackage
- Defined in:
- lib/license_finder/packages/conda_package.rb
Defined Under Namespace
Classes: Identifier
Instance Attribute Summary collapse
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#json ⇒ Object
Returns the value of attribute json.
Attributes inherited from Package
#authors, #description, #groups, #homepage, #install_path, #license_names_from_spec, #logger, #manual_approval, #name, #parents, #summary, #version
Instance Method Summary collapse
- #==(other) ⇒ Object
- #children ⇒ Object
-
#initialize(conda_json) ⇒ CondaPackage
constructor
A new instance of CondaPackage.
- #package_manager ⇒ Object
- #package_url ⇒ Object
- #to_s ⇒ Object
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(conda_json) ⇒ CondaPackage
Returns a new instance of CondaPackage.
7 8 9 10 11 12 13 14 |
# File 'lib/license_finder/packages/conda_package.rb', line 7 def initialize(conda_json) @json = conda_json @identifier = Identifier.from_hash(conda_json) super(@identifier.name, @identifier.version, spec_licenses: Package.license_names_from_standard_spec(conda_json), children: children) end |
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/license_finder/packages/conda_package.rb', line 5 def identifier @identifier end |
#json ⇒ Object
Returns the value of attribute json.
5 6 7 |
# File 'lib/license_finder/packages/conda_package.rb', line 5 def json @json end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/license_finder/packages/conda_package.rb', line 16 def ==(other) other.is_a?(CondaPackage) && @identifier == other.identifier end |
#children ⇒ Object
32 33 34 |
# File 'lib/license_finder/packages/conda_package.rb', line 32 def children @json.fetch('depends', []).map { |constraint| constraint.split.first } end |
#package_manager ⇒ Object
24 25 26 |
# File 'lib/license_finder/packages/conda_package.rb', line 24 def package_manager 'Conda' end |
#package_url ⇒ Object
28 29 30 |
# File 'lib/license_finder/packages/conda_package.rb', line 28 def package_url @json['url'] end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/license_finder/packages/conda_package.rb', line 20 def to_s @identifier.to_s end |