class Gem::Licenses

Constants

EXCEPTION_IDENTIFIERS

exception identifiers

LICENSE_IDENTIFIERS

Software Package Data Exchange (SPDX) standard open-source software license identifiers

LICENSE_REF
NONSTANDARD
REGEXP

Public Class Methods

match?(license) click to toggle source
# File rubygems/util/licenses.rb, line 648
def self.match?(license)
  REGEXP.match?(license)
end
suggestions(license) click to toggle source
# File rubygems/util/licenses.rb, line 652
def self.suggestions(license)
  by_distance = LICENSE_IDENTIFIERS.group_by do |identifier|
    levenshtein_distance(identifier, license)
  end
  lowest = by_distance.keys.min
  return unless lowest < license.size
  by_distance[lowest]
end