Class: RakeCheck::Checker::Cane
- Inherits:
-
Base
- Object
- Base
- RakeCheck::Checker::Cane
show all
- Defined in:
- lib/rake_check/checker/cane.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#check_output, #options, #time
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #status, #type
Instance Method Details
#run ⇒ Object
10
11
12
|
# File 'lib/rake_check/checker/cane.rb', line 10
def run
run_command 'cane'
end
|
#short_message ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/rake_check/checker/cane.rb', line 14
def short_message
@short_message ||= begin
if violations_count > 0
violations = case violations_count
when 0
violations_count.to_s.green
when 1..9
violations_count.to_s.yellow
else
violations_count.to_s.yellow
end
"with #{violations} Violations"
end
end
end
|
#success? ⇒ Boolean
30
31
32
|
# File 'lib/rake_check/checker/cane.rb', line 30
def success?
super && violations_count < 10
end
|
#violations_count ⇒ Object
34
35
36
|
# File 'lib/rake_check/checker/cane.rb', line 34
def violations_count
(check_output[/Total Violations: (\d+)/, 1] || 0).to_i
end
|