summaryrefslogtreecommitdiff
path: root/ale_linters/ruby/ruby.vim
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-28 09:47:04 +0000
committerw0rp <devw0rp@gmail.com>2017-11-28 09:48:35 +0000
commit4e821e64c7292ba635e55c409a015023d7549374 (patch)
tree3fb657e555ce622d41bfd1e111af60e624b2103e /ale_linters/ruby/ruby.vim
parentbba6b4c23ccf556656aac6d12c25c21713179209 (diff)
downloadale-4e821e64c7292ba635e55c409a015023d7549374.zip
Fix #1168 - Make the ruby linter executable configurable
Diffstat (limited to 'ale_linters/ruby/ruby.vim')
-rw-r--r--ale_linters/ruby/ruby.vim16
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',
\})