class Tailor::Rulers::AllowHardTabsRuler

Public Class Methods

new(config, options) click to toggle source
Calls superclass method Tailor::Ruler::new
# File lib/tailor/rulers/allow_hard_tabs_ruler.rb, line 6
def initialize(config, options)
  super(config, options)
  add_lexer_observers :sp
end

Public Instance Methods

measure(token, lineno, column) click to toggle source

Checks to see if the space(s) contains hard tabs.

@param [Fixnum] token The space(s). @param [Fixnum] lineno Line the problem was found on. @param [Fixnum] column Column the problem was found on.

# File lib/tailor/rulers/allow_hard_tabs_ruler.rb, line 20
def measure(token, lineno, column)
  if token.contains_hard_tab?
    problem_message = 'Hard tab found.'

    @problems << Problem.new(problem_type, lineno, column,
      problem_message, @options[:level])
  end
end
sp_update(token, lineno, column) click to toggle source
# File lib/tailor/rulers/allow_hard_tabs_ruler.rb, line 11
def sp_update(token, lineno, column)
  measure(token, lineno, column)
end