Sha256: d970cb341088b4c0432a5557f1a366194c0b75fc969ed41e18ee9645984a2629

Contents?: true

Size: 654 Bytes

Versions: 4

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

require 'spandx/parsers/base'
require 'spandx/parsers/csproj'
require 'spandx/parsers/gemfile_lock'
require 'spandx/parsers/maven'
require 'spandx/parsers/packages_config'
require 'spandx/parsers/pipfile_lock'
require 'spandx/parsers/sln'

module Spandx
  module Parsers
    UNKNOWN = Class.new do
      def self.parse(*_args)
        []
      end
    end

    class << self
      def for(path, catalogue: Spandx::Catalogue.from_git)
        result = ::Spandx::Parsers::Base.find do |x|
          x.matches?(File.basename(path))
        end

        result&.new(catalogue: catalogue) || UNKNOWN
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spandx-0.5.0 lib/spandx/parsers.rb
spandx-0.4.1 lib/spandx/parsers.rb
spandx-0.4.0 lib/spandx/parsers.rb
spandx-0.3.0 lib/spandx/parsers.rb