class Gem::Licenses - Documentation for Ruby 4.0
Description: Documentation for the Gem::Licenses class
Keywords: ruby,class,Gem::Licenses

🔍

No recent searches

# 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)
Source

    # File lib/rubygems/util/licenses.rb, line 876
    def self.deprecated_exception_id?(license)
      DEPRECATED_EXCEPTION_REGEXP.match?(license)
    end

deprecated_license_id? (license)
Source

    # File lib/rubygems/util/licenses.rb, line 872
    def self.deprecated_license_id?(license)
      DEPRECATED_LICENSE_REGEXP.match?(license)
    end

match? (license)
Source

    # File lib/rubygems/util/licenses.rb, line 868
    def self.match?(license)
      VALID_REGEXP.match?(license)
    end

suggestions (license)
Source

    # File lib/rubygems/util/licenses.rb, line 880
    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