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.
11 12 13 14 |
# File 'lib/license_finder/package_managers/nuget.rb', line 11 def initialize(path, name) @path = path @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/license_finder/package_managers/nuget.rb', line 9 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/license_finder/package_managers/nuget.rb', line 9 def path @path end |
Instance Method Details
#dependencies ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/license_finder/package_managers/nuget.rb', line 16 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'], name) end end |