lib/spandx/parsers.rb in spandx-0.1.3 vs lib/spandx/parsers.rb in spandx-0.1.4

- old
+ new

@@ -1,19 +1,27 @@ # frozen_string_literal: true require 'spandx/parsers/base' +require 'spandx/parsers/csproj' require 'spandx/parsers/gemfile_lock' +require 'spandx/parsers/packages_config' require 'spandx/parsers/pipfile_lock' module Spandx module Parsers + UNKNOWN = Class.new do + def self.parse(*_args) + [] + end + end + class << self def for(path, catalogue: Spandx::Catalogue.latest) result = ::Spandx::Parsers::Base.find do |x| x.matches?(File.basename(path)) end - result&.new(catalogue: catalogue) + result&.new(catalogue: catalogue) || UNKNOWN end end end end