lib/slim_lint/linter.rb in slim_lint-0.23.0 vs lib/slim_lint/linter.rb in slim_lint-0.24.0
- old
+ new
@@ -69,21 +69,20 @@
end
def disabled_lines
@disabled_lines ||= begin
currently_disabled = false
- @document.source_lines.each_with_index.reduce([]) do |lines, pair|
+ @document.source_lines.each_with_index.each_with_object([]) do |pair, lines|
line = pair[0]
line_number = pair[1] + 1
if line =~ %r{/ slim-lint:disable #{linter_name}}
currently_disabled = true
elsif line =~ %r{/ slim-lint:enable #{linter_name}}
currently_disabled = false
elsif currently_disabled
lines << line_number
end
- lines
end
end
end
def linter_name