summaryrefslogtreecommitdiff
path: root/ale_linters/eruby
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2019-04-07 14:58:06 +0100
committerw0rp <devw0rp@gmail.com>2019-04-07 14:58:06 +0100
commit3bebcb5d48a7150f5a318952ee309acb67fb376d (patch)
tree97edd84badca566894fd4c4f10c2a786df2fe079 /ale_linters/eruby
parentcdf89f8269aec31d0dfddf3a2769027d72d38155 (diff)
downloadale-3bebcb5d48a7150f5a318952ee309acb67fb376d.zip
#2132 - Replace command_chain and chain_with with ale#command#Run
Diffstat (limited to 'ale_linters/eruby')
-rw-r--r--ale_linters/eruby/erubi.vim17
1 files changed, 7 insertions, 10 deletions
diff --git a/ale_linters/eruby/erubi.vim b/ale_linters/eruby/erubi.vim
index 6f2d3ac6..ddca3f61 100644
--- a/ale_linters/eruby/erubi.vim
+++ b/ale_linters/eruby/erubi.vim
@@ -1,14 +1,10 @@
" Author: Eddie Lebow https://github.com/elebow
" Description: eruby checker using `erubi`
-function! ale_linters#eruby#erubi#CheckErubi(buffer) abort
- return 'ruby -r erubi/capture_end -e ' . ale#Escape('""')
-endfunction
-
-function! ale_linters#eruby#erubi#GetCommand(buffer, check_erubi_output) abort
+function! ale_linters#eruby#erubi#GetCommand(buffer, output, meta) abort
let l:rails_root = ale#ruby#FindRailsRoot(a:buffer)
- if (!empty(a:check_erubi_output))
+ if !empty(a:output)
" The empty command in CheckErubi returns nothing if erubi runs and
" emits an error if erubi is not present
return ''
@@ -27,9 +23,10 @@ endfunction
call ale#linter#Define('eruby', {
\ 'name': 'erubi',
\ 'executable': 'ruby',
-\ 'command_chain': [
-\ {'callback': 'ale_linters#eruby#erubi#CheckErubi'},
-\ {'callback': 'ale_linters#eruby#erubi#GetCommand', 'output_stream': 'stderr'},
-\ ],
+\ 'command': {buffer -> ale#command#Run(
+\ buffer,
+\ 'ruby -r erubi/capture_end -e ' . ale#Escape('""'),
+\ function('ale_linters#eruby#erubi#GetCommand'),
+\ )},
\ 'callback': 'ale#handlers#ruby#HandleSyntaxErrors',
\})