Class: GitHook::Hooks::RubySyntaxCheck::Parser

Inherits:
Ripper
  • Object
show all
Defined in:
lib/git_hook/hooks/ruby_syntax_check.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Parser

Returns a new instance of Parser.



26
27
28
29
30
# File 'lib/git_hook/hooks/ruby_syntax_check.rb', line 26

def initialize(*args)
  super(*args)
  @errors = []
  @warns = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



31
32
33
# File 'lib/git_hook/hooks/ruby_syntax_check.rb', line 31

def errors
  @errors
end

#warnsObject (readonly)

Returns the value of attribute warns.



31
32
33
# File 'lib/git_hook/hooks/ruby_syntax_check.rb', line 31

def warns
  @warns
end

Instance Method Details

#compile_error(msg) ⇒ Object



33
34
35
# File 'lib/git_hook/hooks/ruby_syntax_check.rb', line 33

def compile_error(msg)
  @errors.push(msg)
end

#warn(msg, *args) ⇒ Object



37
38
39
# File 'lib/git_hook/hooks/ruby_syntax_check.rb', line 37

def warn(msg, *args)
  @warns.push(msg)
end