Sha256: d52ae0d7f20710f3b0a973ac7ad36cf6aaf61735f79efcc9e7fd4aa825ae1d8c

Contents?: true

Size: 1.09 KB

Versions: 47

Compression:

Stored size: 1.09 KB

Contents

module Bibliothecary
  module Analyser
    module Determinations
      # calling this with contents=nil can produce less-informed
      # results, but kept for back compat
      def determine_kind(filename, contents = nil)
        determine_kind_from_info(FileInfo.new(nil, filename, contents))
      end

      def determine_kind_from_info(info)
        first_matching_mapping_details(info)
          .fetch(:kind, nil)
      end

      # calling this with contents=nil can produce less-informed
      # results, but kept for back compat
      def determine_can_have_lockfile(filename, contents = nil)
        determine_can_have_lockfile_from_info(FileInfo.new(nil, filename, contents))
      end

      def determine_can_have_lockfile_from_info(info)
        first_matching_mapping_details(info)
          .fetch(:can_have_lockfile, true)
      end

      def groupable?(info)
        # More package managers are groupable than ungroupable, but the methods
        # to get this information should be positive.
        !first_matching_mapping_details(info).fetch(:ungroupable, false)
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
bibliothecary-12.0.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-11.0.1 lib/bibliothecary/analyser/determinations.rb
bibliothecary-11.0.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-10.2.4 lib/bibliothecary/analyser/determinations.rb
bibliothecary-10.2.3 lib/bibliothecary/analyser/determinations.rb
bibliothecary-10.2.2 lib/bibliothecary/analyser/determinations.rb
bibliothecary-10.2.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-10.1.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-10.0.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-9.1.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-9.0.0 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.8.1 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.7 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.6 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.5 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.4 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.3 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.2 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.1 lib/bibliothecary/analyser/determinations.rb
bibliothecary-8.7.0 lib/bibliothecary/analyser/determinations.rb