Class: LicenseFinder::Dotnet::PackageMetadata
- Inherits:
-
Object
- Object
- LicenseFinder::Dotnet::PackageMetadata
- Defined in:
- lib/license_finder/package_managers/dotnet.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#possible_spec_paths ⇒ Object
readonly
Returns the value of attribute possible_spec_paths.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, version, possible_spec_paths) ⇒ PackageMetadata
constructor
A new instance of PackageMetadata.
- #read_license_urls ⇒ Object
Constructor Details
#initialize(name, version, possible_spec_paths) ⇒ PackageMetadata
Returns a new instance of PackageMetadata.
38 39 40 41 42 |
# File 'lib/license_finder/package_managers/dotnet.rb', line 38 def initialize(name, version, possible_spec_paths) @name = name @version = version @possible_spec_paths = possible_spec_paths end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
36 37 38 |
# File 'lib/license_finder/package_managers/dotnet.rb', line 36 def name @name end |
#possible_spec_paths ⇒ Object (readonly)
Returns the value of attribute possible_spec_paths.
36 37 38 |
# File 'lib/license_finder/package_managers/dotnet.rb', line 36 def possible_spec_paths @possible_spec_paths end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
36 37 38 |
# File 'lib/license_finder/package_managers/dotnet.rb', line 36 def version @version end |
Instance Method Details
#==(other) ⇒ Object
50 51 52 |
# File 'lib/license_finder/package_managers/dotnet.rb', line 50 def ==(other) other.name == name && other.version == version && other.possible_spec_paths == possible_spec_paths end |
#read_license_urls ⇒ Object
44 45 46 47 48 |
# File 'lib/license_finder/package_managers/dotnet.rb', line 44 def read_license_urls possible_spec_paths.flat_map do |path| Nuget.nuspec_license_urls(File.read(path)) if File.exist? path end.compact end |