Class: RubomaticHtml::Cop::Layout::MultipleLineBreaks
- Defined in:
- lib/rubomatic-html/cop/layout/multiple_line_breaks.rb
Instance Attribute Summary collapse
-
#prev_break ⇒ Boolean
Tracks multiple consecutive line breaks.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MultipleLineBreaks
constructor
:nodoc:.
- #run_for_line(line, index) ⇒ Object
Methods inherited from Base
Methods inherited from Base
Constructor Details
#initialize ⇒ MultipleLineBreaks
:nodoc:
23 24 25 26 27 |
# File 'lib/rubomatic-html/cop/layout/multiple_line_breaks.rb', line 23 def initialize(...) super(...) @prev_break = false end |
Instance Attribute Details
#prev_break ⇒ Boolean
Returns tracks multiple consecutive line breaks.
8 9 10 |
# File 'lib/rubomatic-html/cop/layout/multiple_line_breaks.rb', line 8 def prev_break @prev_break end |
Class Method Details
.abstract_cop? ⇒ Boolean
12 13 14 |
# File 'lib/rubomatic-html/cop/layout/multiple_line_breaks.rb', line 12 def abstract_cop? false end |
.name ⇒ Object
17 18 19 |
# File 'lib/rubomatic-html/cop/layout/multiple_line_breaks.rb', line 17 def name [department, 'MultipleLineBreaks'].join('/') end |
Instance Method Details
#run_for_line(line, index) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/rubomatic-html/cop/layout/multiple_line_breaks.rb', line 30 def run_for_line(line, index) if prev_break && line.empty? puts("#{file}:#{index}: has multiple line breaks") elsif line.empty? @prev_break = true else @prev_break = false end end |