Class: Gem::Licenses (Ruby 2.3.4)

In Files

  • rubygems/util/licenses.rb

Parent

Class/Module Index [+]

Quicksearch

Gem::Licenses

Constants

IDENTIFIERS

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

NONSTANDARD
REGEXP

Public Class Methods

match?(license)
 
               # File rubygems/util/licenses.rb, line 331
def self.match?(license)
  !REGEXP.match(license).nil?
end
            
suggestions(license)
 
               # File rubygems/util/licenses.rb, line 335
def self.suggestions(license)
  by_distance = IDENTIFIERS.group_by do |identifier|
    levenshtein_distance(identifier, license)
  end
  lowest = by_distance.keys.min
  return unless lowest < license.size
  by_distance[lowest]
end