Class: Spandx::Dotnet::ProjectFile

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/dotnet/project_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#catalogueObject (readonly)

Returns the value of attribute catalogue.



6
7
8
# File 'lib/spandx/dotnet/project_file.rb', line 6

def catalogue
  @catalogue
end

#documentObject (readonly)

Returns the value of attribute document.



6
7
8
# File 'lib/spandx/dotnet/project_file.rb', line 6

def document
  @document
end

#nugetObject (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_referencesObject



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