11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/code_keeper/cli.rb', line 11
def self.run(paths)
if paths.empty?
puts 'Specify at least one argument, a file or a directory.'
return ERROR_CODE
end
result = CodeKeeper::Scorer.keep(paths)
puts ::CodeKeeper::Formatter.format(result)
SUCCESS_CODE
rescue Interrupt
puts 'Exiting...'
INTERRUPTION_CODE
rescue CodeKeeper::TargetFileNotFoundError => e
puts e.message
ERROR_CODE
rescue StandardError => e
puts e.message
GENERAL_ERROR_CODE
end
|