Class: SandiMeter::WarningScanner

Inherits:
Object
  • Object
show all
Defined in:
lib/sandi_meter/warning_scanner.rb

Constant Summary collapse

INDENTATION_WARNING_REGEXP =
/at 'end' with '(def|class|module)' at (\d+)\z/

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indentation_warningsObject (readonly)

Returns the value of attribute indentation_warnings.



5
6
7
# File 'lib/sandi_meter/warning_scanner.rb', line 5

def indentation_warnings
  @indentation_warnings
end

Instance Method Details

#scan(source) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/sandi_meter/warning_scanner.rb', line 9

def scan(source)
  status, @warnings, process = if defined? Bundler
                              Bundler.with_clean_env do
                                   validate(source)
                                end
                              else
                                validate(source)
                              end

  check_syntax(status)
  @indentation_warnings = parse_warnings
end