Reference a global ruby path for syntax checking, same variable as rubycomplete

This commit is contained in:
Chris Hoffman 2010-07-31 04:34:35 -05:00
parent a4b0399e22
commit e347b10534

View File

@ -15,12 +15,16 @@ endif
let loaded_ruby_syntax_checker = 1 let loaded_ruby_syntax_checker = 1
"bail if the user doesnt have ruby installed "bail if the user doesnt have ruby installed
if !executable("ruby") if !exists('g:ruby_path') && !executable("ruby")
finish finish
endif endif
function! SyntaxCheckers_ruby_GetLocList() function! SyntaxCheckers_ruby_GetLocList()
if exists('g:ruby_path')
let makeprg = 'RUBYOPT= ' . g:ruby_path . ' -W1 -c %'
else
let makeprg = 'RUBYOPT= ruby -W1 -c %' let makeprg = 'RUBYOPT= ruby -W1 -c %'
endif
let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%-C%.%#' let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })