summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-09-12 21:29:41 +0100
committerGitHub <noreply@github.com>2019-09-12 21:29:41 +0100
commitb66d202c1dfc1354d09f8d5eacef54404e9b2c57 (patch)
treebf630632e800cb9b4412206864b8817c48bd5e52 /autoload
parent05ba522c9af59aaf0d34aff2674c2ac273dc1a88 (diff)
parent58e8d32d790ea3bb370b928581d5ec163cc7e930 (diff)
downloadale-b66d202c1dfc1354d09f8d5eacef54404e9b2c57.zip
Merge pull request #2695 from elebow/move-ruby-escape-executable
Move ale#handlers#ruby#EscapeExecutable to ale#ruby#EscapeExecutable
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/rubocop.vim2
-rw-r--r--autoload/ale/fixers/sorbet.vim2
-rw-r--r--autoload/ale/fixers/standardrb.vim2
-rw-r--r--autoload/ale/handlers/ruby.vim8
-rw-r--r--autoload/ale/ruby.vim7
5 files changed, 10 insertions, 11 deletions
diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim
index 33ba6887..0c7441e4 100644
--- a/autoload/ale/fixers/rubocop.vim
+++ b/autoload/ale/fixers/rubocop.vim
@@ -6,7 +6,7 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort
let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
- return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop')
+ return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --auto-correct --force-exclusion %t'
diff --git a/autoload/ale/fixers/sorbet.vim b/autoload/ale/fixers/sorbet.vim
index 182f7300..7c12fa1e 100644
--- a/autoload/ale/fixers/sorbet.vim
+++ b/autoload/ale/fixers/sorbet.vim
@@ -5,7 +5,7 @@ function! ale#fixers#sorbet#GetCommand(buffer) abort
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
- return ale#handlers#ruby#EscapeExecutable(l:executable, 'srb')
+ return ale#ruby#EscapeExecutable(l:executable, 'srb')
\ . ' tc'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --autocorrect --file %t'
diff --git a/autoload/ale/fixers/standardrb.vim b/autoload/ale/fixers/standardrb.vim
index fab1e2bc..54330a37 100644
--- a/autoload/ale/fixers/standardrb.vim
+++ b/autoload/ale/fixers/standardrb.vim
@@ -9,7 +9,7 @@ function! ale#fixers#standardrb#GetCommand(buffer) abort
let l:config = ale#path#FindNearestFile(a:buffer, '.standard.yml')
let l:options = ale#Var(a:buffer, 'ruby_standardrb_options')
- return ale#handlers#ruby#EscapeExecutable(l:executable, 'standardrb')
+ return ale#ruby#EscapeExecutable(l:executable, 'standardrb')
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --fix --force-exclusion %t'
diff --git a/autoload/ale/handlers/ruby.vim b/autoload/ale/handlers/ruby.vim
index c28b8b75..7a1c5765 100644
--- a/autoload/ale/handlers/ruby.vim
+++ b/autoload/ale/handlers/ruby.vim
@@ -36,11 +36,3 @@ endfunction
function! ale#handlers#ruby#HandleSyntaxErrors(buffer, lines) abort
return s:HandleSyntaxError(a:buffer, a:lines)
endfunction
-
-function! ale#handlers#ruby#EscapeExecutable(executable, bundle_exec) abort
- let l:exec_args = a:executable =~? 'bundle'
- \ ? ' exec ' . a:bundle_exec
- \ : ''
-
- return ale#Escape(a:executable) . l:exec_args
-endfunction
diff --git a/autoload/ale/ruby.vim b/autoload/ale/ruby.vim
index 15e835c9..d941bb2c 100644
--- a/autoload/ale/ruby.vim
+++ b/autoload/ale/ruby.vim
@@ -74,3 +74,10 @@ function! ale#ruby#HandleRubocopOutput(buffer, lines) abort
return l:output
endfunction
+function! ale#ruby#EscapeExecutable(executable, bundle_exec) abort
+ let l:exec_args = a:executable =~? 'bundle'
+ \ ? ' exec ' . a:bundle_exec
+ \ : ''
+
+ return ale#Escape(a:executable) . l:exec_args
+endfunction