Module: LicenseFinder::Logger
- Defined in:
- lib/license_finder/logger.rb
Defined Under Namespace
Classes: Base, Progress, Quiet, Verbose
Constant Summary
collapse
- Default =
Quiet
Class Method Summary
collapse
Class Method Details
.colorize(string, color) ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/license_finder/logger.rb', line 14
def self.colorize(string, color)
case color
when :red
"\e[31m#{string}\e[0m"
when :green
"\e[32m#{string}\e[0m"
else
string
end
end
|
.new(options = {}) ⇒ Object
3
4
5
6
7
8
9
10
11
12
|
# File 'lib/license_finder/logger.rb', line 3
def self.new(options = {})
klass = if options[:quiet]
Quiet
elsif options[:debug]
Verbose
else
Progress
end
klass.new
end
|