2017-04-08 06:24:20 -04:00
|
|
|
" Author: Brandon Roehl - https://github.com/BrandonRoehl
|
|
|
|
" Description: Ruby MRI for Ruby files
|
|
|
|
|
2017-11-28 04:47:04 -05:00
|
|
|
call ale#Set('ruby_ruby_executable', 'ruby')
|
|
|
|
|
|
|
|
function! ale_linters#ruby#ruby#GetExecutable(buffer) abort
|
|
|
|
return ale#Var(a:buffer, 'ruby_ruby_executable')
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! ale_linters#ruby#ruby#GetCommand(buffer) abort
|
|
|
|
let l:executable = ale_linters#ruby#ruby#GetExecutable(a:buffer)
|
|
|
|
|
|
|
|
return ale#Escape(l:executable) . ' -w -c -T1 %t'
|
|
|
|
endfunction
|
|
|
|
|
2017-04-08 06:24:20 -04:00
|
|
|
call ale#linter#Define('ruby', {
|
|
|
|
\ 'name': 'ruby',
|
2017-11-28 04:47:04 -05:00
|
|
|
\ 'executable_callback': 'ale_linters#ruby#ruby#GetExecutable',
|
|
|
|
\ 'command_callback': 'ale_linters#ruby#ruby#GetCommand',
|
2017-04-08 06:24:20 -04:00
|
|
|
\ 'output_stream': 'stderr',
|
2017-04-25 13:38:02 -04:00
|
|
|
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
|
2017-04-08 06:24:20 -04:00
|
|
|
\})
|