class Gem::Licenses

常量

DEPRECATED_EXCEPTION_IDENTIFIERS
DEPRECATED_EXCEPTION_REGEXP
DEPRECATED_LICENSE_IDENTIFIERS
DEPRECATED_LICENSE_REGEXP
EXCEPTION_IDENTIFIERS

异常标识符

LICENSE_IDENTIFIERS

软件包装数据交换 (SPDX) 标准开源软件许可证标识符

LICENSE_REF
NONSTANDARD
VALID_REGEXP

公共类方法

deprecated_exception_id?(license) 点击切换源代码
# File rubygems/util/licenses.rb, line 803
def self.deprecated_exception_id?(license)
  DEPRECATED_EXCEPTION_REGEXP.match?(license)
end
deprecated_license_id?(license) 点击切换源代码
# File rubygems/util/licenses.rb, line 799
def self.deprecated_license_id?(license)
  DEPRECATED_LICENSE_REGEXP.match?(license)
end
match?(license) 点击切换源代码
# File rubygems/util/licenses.rb, line 795
def self.match?(license)
  VALID_REGEXP.match?(license)
end
suggestions(license) 点击切换源代码
# 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