Class: Spandx::Dotnet::ProjectFile
- Inherits:
-
Object
- Object
- Spandx::Dotnet::ProjectFile
- Defined in:
- lib/spandx/dotnet/project_file.rb
Instance Attribute Summary collapse
-
#catalogue ⇒ Object
readonly
Returns the value of attribute catalogue.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#nuget ⇒ Object
readonly
Returns the value of attribute nuget.
Instance Method Summary collapse
-
#initialize(path) ⇒ ProjectFile
constructor
A new instance of ProjectFile.
- #package_references ⇒ Object
Constructor Details
#initialize(path) ⇒ ProjectFile
Returns a new instance of ProjectFile.
8 9 10 11 12 |
# File 'lib/spandx/dotnet/project_file.rb', line 8 def initialize(path) @path = Pathname(path) @dir = @path.dirname @document = Nokogiri::XML(@path.read).tap(&:remove_namespaces!) end |
Instance Attribute Details
#catalogue ⇒ Object (readonly)
Returns the value of attribute catalogue.
6 7 8 |
# File 'lib/spandx/dotnet/project_file.rb', line 6 def catalogue @catalogue end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
6 7 8 |
# File 'lib/spandx/dotnet/project_file.rb', line 6 def document @document end |
#nuget ⇒ Object (readonly)
Returns the value of attribute nuget.
6 7 8 |
# File 'lib/spandx/dotnet/project_file.rb', line 6 def nuget @nuget end |
Instance Method Details
#package_references ⇒ Object
14 15 16 17 18 |
# File 'lib/spandx/dotnet/project_file.rb', line 14 def package_references project_references.flat_map(&:package_references) + references('GlobalPackageReference') + references('PackageReference') end |