Class: LicenseFinder::Nuget::Assembly
- Inherits:
-
Object
- Object
- LicenseFinder::Nuget::Assembly
- Defined in:
- lib/license_finder/package_managers/nuget.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(path, name) ⇒ Assembly
constructor
A new instance of Assembly.
Constructor Details
#initialize(path, name) ⇒ Assembly
Returns a new instance of Assembly.
55 56 57 58 |
# File 'lib/license_finder/package_managers/nuget.rb', line 55 def initialize(path, name) @path = path @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
54 55 56 |
# File 'lib/license_finder/package_managers/nuget.rb', line 54 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
54 55 56 |
# File 'lib/license_finder/package_managers/nuget.rb', line 54 def path @path end |
Instance Method Details
#dependencies ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/license_finder/package_managers/nuget.rb', line 60 def dependencies xml = REXML::Document.new(File.read(path.join("packages.config"))) packages = REXML::XPath.match(xml, "//package") packages.map do |p| attrs = p.attributes Dependency.new(attrs["id"], attrs["version"], self.name) end end |