Module: ReVIEW::ErrorUtils

Included in:
Preprocessor, Repository
Defined in:
lib/review/preprocessor.rb

Instance Method Summary collapse

Instance Method Details

#error(msg) ⇒ Object

Raises:



30
31
32
33
# File 'lib/review/preprocessor.rb', line 30

def error(msg)
  @errutils_err = true
  raise ApplicationError, "#{location()}: #{msg}"
end

#filenameObject



39
40
41
# File 'lib/review/preprocessor.rb', line 39

def filename
  @errutils_file.path
end

#init_ErrorUtils(f) ⇒ Object



21
22
23
24
# File 'lib/review/preprocessor.rb', line 21

def init_ErrorUtils(f)
  @errutils_file = f
  @errutils_err = false
end

#linenoObject



43
44
45
# File 'lib/review/preprocessor.rb', line 43

def lineno
  @errutils_file.lineno
end

#locationObject



35
36
37
# File 'lib/review/preprocessor.rb', line 35

def location
  "#{filename()}:#{lineno()}"
end

#warn(msg) ⇒ Object



26
27
28
# File 'lib/review/preprocessor.rb', line 26

def warn(msg)
  $stderr.puts "#{location()}: warning: #{msg}"
end