[neovim] 01/02: runtime: Allow overriding ruby host with g:ruby_host_prog

Jason Pleau jpleau-guest at moszumanska.debian.org
Wed Aug 2 23:15:36 UTC 2017


This is an automated email from the git hooks/post-receive script.

jpleau-guest pushed a commit to branch debian/sid
in repository neovim.

commit 09c4177bca9ae279877affb88d25cdeb84b5e6f1
Author: Alex Genco <alexgenco at gmail.com>
Date:   Sat Jun 3 17:19:49 2017 -0700

    runtime: Allow overriding ruby host with g:ruby_host_prog
    
    This allows users who have per-project Ruby versions (e.g. with `rvm`)
    to pin to a particular gem installation.
    
    For example: `let g:ruby_host_prog = 'rvm system do neovim-ruby-host'`
---
 runtime/autoload/provider/ruby.vim | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim
index c8ede20..91b7fb9 100644
--- a/runtime/autoload/provider/ruby.vim
+++ b/runtime/autoload/provider/ruby.vim
@@ -16,7 +16,11 @@ function! s:job_opts.on_stderr(chan_id, data, event)
 endfunction
 
 function! provider#ruby#Detect() abort
-  return exepath('neovim-ruby-host')
+  if exists("g:ruby_host_prog")
+    return g:ruby_host_prog
+  else
+    return exepath('neovim-ruby-host')
+  end
 endfunction
 
 function! provider#ruby#Prog()
@@ -24,15 +28,15 @@ function! provider#ruby#Prog()
 endfunction
 
 function! provider#ruby#Require(host) abort
-  let args = [provider#ruby#Prog()]
+  let prog = provider#ruby#Prog()
   let ruby_plugins = remote#host#PluginsForHost(a:host.name)
 
   for plugin in ruby_plugins
-    call add(args, plugin.path)
+    let prog .= " " . shellescape(plugin.path)
   endfor
 
   try
-    let channel_id = jobstart(args, s:job_opts)
+    let channel_id = jobstart(prog, s:job_opts)
     if rpcrequest(channel_id, 'poll') ==# 'ok'
       return channel_id
     endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/neovim.git



More information about the pkg-vim-maintainers mailing list