Sha256: fd4d4ba2c9dbbb11602d00af8a4bf0d1251ab31c8b5755591387a0c02eb9f3f4

Contents?: true

Size: 651 Bytes

Versions: 12

Compression:

Stored size: 651 Bytes

Contents

# frozen_string_literal: true

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

      def match?(_path)
        raise ::Spandx::Error, :match?
      end

      def parse(_dependency)
        raise ::Spandx::Error, :parse
      end

      class << self
        include Registerable

        def parse(path)
          self.for(path).parse(path)
        end

        def for(path)
          path = Pathname.new(path)
          return UNKNOWN if !path.exist? || path.zero?

          find { |x| x.match?(path) } || UNKNOWN
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
spandx-0.18.3 lib/spandx/core/parser.rb
spandx-0.18.2 lib/spandx/core/parser.rb
spandx-0.18.1 lib/spandx/core/parser.rb
spandx-0.18.0 lib/spandx/core/parser.rb
spandx-0.17.0 lib/spandx/core/parser.rb
spandx-0.16.1 lib/spandx/core/parser.rb
spandx-0.16.0 lib/spandx/core/parser.rb
spandx-0.15.1 lib/spandx/core/parser.rb
spandx-0.15.0 lib/spandx/core/parser.rb
spandx-0.14.0 lib/spandx/core/parser.rb
spandx-0.13.5 lib/spandx/core/parser.rb
spandx-0.13.4 lib/spandx/core/parser.rb