mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #6841 from alexgenco/ruby-host-prog
This commit is contained in:
commit
3a86dd54f3
@ -460,7 +460,7 @@ function! s:check_ruby() abort
|
|||||||
\ 'Are you behind a firewall or proxy?'])
|
\ 'Are you behind a firewall or proxy?'])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let latest_gem = get(split(latest_gem, ' (\|, \|)$' ), 1, 'not found')
|
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found')
|
||||||
|
|
||||||
let current_gem_cmd = host .' --version'
|
let current_gem_cmd = host .' --version'
|
||||||
let current_gem = s:system(current_gem_cmd)
|
let current_gem = s:system(current_gem_cmd)
|
||||||
|
@ -16,7 +16,11 @@ function! s:job_opts.on_stderr(chan_id, data, event)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#ruby#Detect() abort
|
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
|
endfunction
|
||||||
|
|
||||||
function! provider#ruby#Prog()
|
function! provider#ruby#Prog()
|
||||||
@ -24,15 +28,15 @@ function! provider#ruby#Prog()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#ruby#Require(host) abort
|
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)
|
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
||||||
|
|
||||||
for plugin in ruby_plugins
|
for plugin in ruby_plugins
|
||||||
call add(args, plugin.path)
|
let prog .= " " . shellescape(plugin.path)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
try
|
try
|
||||||
let channel_id = jobstart(args, s:job_opts)
|
let channel_id = jobstart(prog, s:job_opts)
|
||||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||||
return channel_id
|
return channel_id
|
||||||
endif
|
endif
|
||||||
|
@ -99,6 +99,19 @@ RUBY PROVIDER CONFIGURATION ~
|
|||||||
*g:loaded_ruby_provider*
|
*g:loaded_ruby_provider*
|
||||||
To disable Ruby support: >
|
To disable Ruby support: >
|
||||||
let g:loaded_ruby_provider = 1
|
let g:loaded_ruby_provider = 1
|
||||||
|
<
|
||||||
|
*g:ruby_host_prog*
|
||||||
|
Command to start the Ruby host. By default this is `neovim-ruby-host`. For users
|
||||||
|
who use per-project Ruby versions with tools like RVM or rbenv, setting this can
|
||||||
|
prevent the need to install the `neovim` gem in every project.
|
||||||
|
|
||||||
|
To use an absolute path (e.g. to an rbenv installation): >
|
||||||
|
let g:ruby_host_prog = '~/.rbenv/versions/2.4.1/bin/neovim-ruby-host'
|
||||||
|
<
|
||||||
|
|
||||||
|
To use the RVM "system" Ruby installation: >
|
||||||
|
let g:ruby_host_prog = 'rvm system do neovim-ruby-host'
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Clipboard integration *provider-clipboard* *clipboard*
|
Clipboard integration *provider-clipboard* *clipboard*
|
||||||
|
Loading…
Reference in New Issue
Block a user