Class: Spandx::Core::Parser
- Inherits:
-
Object
- Object
- Spandx::Core::Parser
- Extended by:
- Registerable
- Defined in:
- lib/spandx/core/parser.rb
Direct Known Subclasses
Dotnet::Parsers::Csproj, Dotnet::Parsers::PackagesConfig, Dotnet::Parsers::Sln, Java::Parsers::Maven, Js::Parsers::Npm, Js::Parsers::Yarn, Os::Parsers::Apk, Os::Parsers::Dpkg, Php::Parsers::Composer, Python::Parsers::PipfileLock, Ruby::Parsers::GemfileLock, Terraform::Parsers::LockFile
Constant Summary collapse
- UNKNOWN =
Class.new do def self.parse(*_args) [] end end
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Registerable
all, each, inherited, registry
Class Method Details
.for(path) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/spandx/core/parser.rb', line 27 def for(path) path = Pathname.new(path) return UNKNOWN if !path.exist? || path.zero? find { |x| x.match?(path) } || UNKNOWN end |
.parse(path) ⇒ Object
23 24 25 |
# File 'lib/spandx/core/parser.rb', line 23 def parse(path) self.for(path).parse(path) end |