class Gem::Licenses
Constants
- DEPRECATED_EXCEPTION_IDENTIFIERS
- DEPRECATED_EXCEPTION_REGEXP
- DEPRECATED_LICENSE_IDENTIFIERS
- DEPRECATED_LICENSE_REGEXP
- EXCEPTION_IDENTIFIERS
-
exception identifiers
- LICENSE_IDENTIFIERS
-
Software Package
Data
Exchange (SPDX) standard open-source software license identifiers - LICENSE_REF
- NONSTANDARD
- VALID_REGEXP
Public Class Methods
Source
# File lib/rubygems/util/licenses.rb, line 803 def self.deprecated_exception_id?(license) DEPRECATED_EXCEPTION_REGEXP.match?(license) end
Source
# File lib/rubygems/util/licenses.rb, line 799 def self.deprecated_license_id?(license) DEPRECATED_LICENSE_REGEXP.match?(license) end
Source
# File lib/rubygems/util/licenses.rb, line 795 def self.match?(license) VALID_REGEXP.match?(license) end
Source
# File lib/rubygems/util/licenses.rb, line 807 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