Sha256: 199365c1d76e80e5ced6e700c2cd552a0d33227d14082206abe529a4ecb6ddc0

Contents?: true

Size: 710 Bytes

Versions: 4

Compression:

Stored size: 710 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/licensee'

path = ARGV[0] || Dir.pwd

def print_file(license_file)
  if license_file
    puts "License file: #{license_file.filename}"
    puts "Attribution: #{license_file.attribution}" if license_file.attribution
  end
end

def print_evaluation(file)
  if file
    puts "License: #{file.license ? file.license.meta['title'] : 'no license'}"
    puts "Confidence: #{format('%.2f', file.confidence)}%" if file.confidence
    puts "Method: #{file.matcher.class}" if file.matcher
  else
    puts 'Unknown'
  end
end

project = Licensee.project(path, detect_packages: true, detect_readme: true)
print_file(project.license_file)
print_evaluation(project.matched_file)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
licensee-8.4.0 bin/licensee
licensee-8.3.1 bin/licensee
licensee-8.3.0 bin/licensee
licensee-8.2.0 bin/licensee