Class: SCSSLint::AutoCorrect::Correctors::EmptyLineBetweenBlocks

Inherits:
Base
  • Object
show all
Defined in:
lib/scss_lint/auto_correct/correctors/empty_line_between_blocks.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#enabled?, #initialize, linter_name, priority, short_name

Constructor Details

This class inherits a constructor from SCSSLint::AutoCorrect::Correctors::Base

Class Method Details

.descriptionObject



9
10
11
# File 'lib/scss_lint/auto_correct/correctors/empty_line_between_blocks.rb', line 9

def self.description
  "Ensures empty lines between block defintions"
end

Instance Method Details

#call(contents) ⇒ Object



3
4
5
6
7
# File 'lib/scss_lint/auto_correct/correctors/empty_line_between_blocks.rb', line 3

def call(contents)
  contents.gsub(/}\n( *[\.a-zA-Z0-9=\-:&\[\]]+) {/m) do
    "}\n\n#{Regexp.last_match[1]} {"
  end
end