Class: Spdx

Inherits:
Object
  • Object
show all
Defined in:
lib/utils/spdx.rb

Overview

author: Christoph Hartmann author: Dominik Richter

Class Method Summary collapse

Class Method Details

.licensesObject



5
6
7
8
# File 'lib/utils/spdx.rb', line 5

def self.licenses
  spdx_file = File.join(File.dirname(__FILE__), 'spdx.txt').freeze
  File.read(spdx_file).split("\n")
end

.valid_license?(license) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/utils/spdx.rb', line 10

def self.valid_license?(license)
  licenses.include?(license)
end