diff options
Diffstat (limited to 'ale_linters/ruby')
-rw-r--r-- | ale_linters/ruby/ruby.vim | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ale_linters/ruby/ruby.vim b/ale_linters/ruby/ruby.vim index a9f7b51b..1aa88851 100644 --- a/ale_linters/ruby/ruby.vim +++ b/ale_linters/ruby/ruby.vim @@ -1,10 +1,22 @@ " Author: Brandon Roehl - https://github.com/BrandonRoehl " Description: Ruby MRI for Ruby files +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 + call ale#linter#Define('ruby', { \ 'name': 'ruby', -\ 'executable': 'ruby', +\ 'executable_callback': 'ale_linters#ruby#ruby#GetExecutable', +\ 'command_callback': 'ale_linters#ruby#ruby#GetCommand', \ 'output_stream': 'stderr', -\ 'command': 'ruby -w -c -T1 %t', \ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors', \}) |