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
deprecated_exception_id?(license)
click to toggle source
# File rubygems/util/licenses.rb, line 803 def self.deprecated_exception_id?(license) DEPRECATED_EXCEPTION_REGEXP.match?(license) end
deprecated_license_id?(license)
click to toggle source
# File rubygems/util/licenses.rb, line 799 def self.deprecated_license_id?(license) DEPRECATED_LICENSE_REGEXP.match?(license) end
match?(license)
click to toggle source
# File rubygems/util/licenses.rb, line 795 def self.match?(license) VALID_REGEXP.match?(license) end
suggestions(license)
click to toggle source
# File 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