diff options
author | Alex Genco <alexgenco@gmail.com> | 2016-07-02 21:49:04 -0700 |
---|---|---|
committer | Alex Genco <alexgenco@gmail.com> | 2016-07-08 16:58:17 -0700 |
commit | ce91baf94b583982ba28b721b7c13833c7132d85 (patch) | |
tree | fd7c535bc61a1af14335c4f38eb0534ed09ab482 | |
parent | 0a3c0205c5b9043d371133297439a11e0186585d (diff) | |
download | rneovim-ce91baf94b583982ba28b721b7c13833c7132d85.tar.gz rneovim-ce91baf94b583982ba28b721b7c13833c7132d85.tar.bz2 rneovim-ce91baf94b583982ba28b721b7c13833c7132d85.zip |
Add Ruby diagnosis to :CheckHealth command
-rw-r--r-- | runtime/autoload/health.vim | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index dc362577a6..0a698e6492 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -404,6 +404,39 @@ function! s:diagnose_python(version) abort endfunction +function! s:diagnose_ruby() abort + echo 'Checking: Ruby' + let ruby_vers = systemlist('ruby -v')[0] + let ruby_prog = provider#ruby#Detect() + let notes = [] + + if empty(ruby_prog) + let ruby_prog = 'not found' + let prog_vers = 'not found' + call add(notes, 'Suggestion: Install the neovim RubyGem using ' . + \ '`gem install neovim`.') + else + silent let prog_vers = systemlist(ruby_prog . ' --version')[0] + + if v:shell_error + let prog_vers = 'outdated' + call add(notes, 'Suggestion: Install the latest neovim RubyGem using ' . + \ '`gem install neovim`.') + elseif s:version_cmp(prog_vers, "0.2.0") == -1 + let prog_vers .= ' (outdated)' + call add(notes, 'Suggestion: Install the latest neovim RubyGem using ' . + \ '`gem install neovim`.') + endif + endif + + echo ' Ruby Version: ' . ruby_vers + echo ' Host Executable: ' . ruby_prog + echo ' Host Version: ' . prog_vers + + call s:echo_notes(notes) +endfunction + + function! health#check(bang) abort redir => report try @@ -411,6 +444,8 @@ function! health#check(bang) abort silent echo '' silent call s:diagnose_python(3) silent echo '' + silent call s:diagnose_ruby() + silent echo '' silent call s:diagnose_manifest() silent echo '' finally |