From 4e821e64c7292ba635e55c409a015023d7549374 Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 28 Nov 2017 09:47:04 +0000 Subject: Fix #1168 - Make the ruby linter executable configurable --- ale_linters/ruby/ruby.vim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ale_linters/ruby') 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', \}) -- cgit v1.2.3