Module: ReVIEW::ErrorUtils
- Included in:
- Preprocessor, Repository
- Defined in:
- lib/review/preprocessor.rb
Instance Method Summary collapse
- #error(msg) ⇒ Object
- #filename ⇒ Object
- #init_ErrorUtils(f) ⇒ Object
- #lineno ⇒ Object
- #location ⇒ Object
- #warn(msg) ⇒ Object
Instance Method Details
#error(msg) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/review/preprocessor.rb', line 37 def error(msg) if @param["outencoding"] =~ /^EUC$/ msg = NKF.nkf("-W -e", msg) elsif @param["outencoding"] =~ /^SJIS$/ msg = NKF.nkf("-W -s", msg) elsif @param["outencoding"] =~ /^JIS$/ msg = NKF.nkf("-W -j", msg) end @errutils_err = true raise ApplicationError, "#{location()}: #{msg}" end |
#filename ⇒ Object
53 54 55 |
# File 'lib/review/preprocessor.rb', line 53 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 |
#lineno ⇒ Object
57 58 59 |
# File 'lib/review/preprocessor.rb', line 57 def lineno @errutils_file.lineno end |
#location ⇒ Object
49 50 51 |
# File 'lib/review/preprocessor.rb', line 49 def location "#{filename()}:#{lineno()}" end |
#warn(msg) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/review/preprocessor.rb', line 26 def warn(msg) if @param["outencoding"] =~ /^EUC$/ msg = NKF.nkf("-W -e", msg) elsif @param["outencoding"] =~ /^SJIS$/ msg = NKF.nkf("-W -s", msg) elsif @param["outencoding"] =~ /^JIS$/ msg = NKF.nkf("-W -j", msg) end $stderr.puts "#{location()}: warning: #{msg}" end |