Class: Spdx

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

Class Method Summary collapse

Class Method Details

.licensesObject



2
3
4
5
# File 'lib/inspec/utils/spdx.rb', line 2

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)


7
8
9
# File 'lib/inspec/utils/spdx.rb', line 7

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