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.
50 51 52 53 |
# File 'lib/license_finder/package_managers/nuget.rb', line 50 def initialize(path, name) @path = path @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
49 50 51 |
# File 'lib/license_finder/package_managers/nuget.rb', line 49 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
49 50 51 |
# File 'lib/license_finder/package_managers/nuget.rb', line 49 def path @path end |
Instance Method Details
#dependencies ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/license_finder/package_managers/nuget.rb', line 55 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 |