Class: LicenseeCLI
Overview
licensee license-path command implementation.
Constant Summary
Licensee::Commands::DetectCLIHelpers::MATCHED_FILE_METHODS
Instance Method Summary
collapse
Instance Method Details
#detect(_path = nil) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/licensee/commands/detect.rb', line 20
def detect(_path = nil)
Licensee.confidence_threshold = options[:confidence]
if options[:recursive]
handle_recursive_detect
else
handle_json_output if options[:json]
print_project_summary
print_matched_files
maybe_diff_license_file
end
end
|
#diff(_path = nil) ⇒ Object
10
11
12
13
14
15
|
# File 'lib/licensee/commands/diff.rb', line 10
def diff(_path = nil)
say "Comparing to #{expected_license.name}:"
print_table diff_summary_rows
exit_on_exact_match
say diff_output
end
|
#license_path(path) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/licensee/commands/license_path.rb', line 6
def license_path(path)
project = Licensee.project(path)
exit 1 unless project.license_file
if remote?
say project.license_file.path
else
say File.expand_path(project.license_file.path, path)
end
end
|
#version ⇒ Object
6
7
8
|
# File 'lib/licensee/commands/version.rb', line 6
def version
say Licensee::VERSION
end
|