PATCH: include gems load path in 'path'

Doug Kearns dougkearns at gmail.com
Sun Sep 11 05:39:38 EDT 2005


This includes the gems load path in 'path' so that :find and friends
will search there first.

Is my limited understanding of gems correct?

Regards,
Doug


Index: ftplugin/ruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/ftplugin/ruby.vim,v
retrieving revision 1.10
diff -u -r1.10 ruby.vim
--- ftplugin/ruby.vim	10 Sep 2005 07:46:45 -0000	1.10
+++ ftplugin/ruby.vim	11 Sep 2005 09:05:33 -0000
@@ -67,9 +67,9 @@
 if !exists("s:rubypath")
   if executable("ruby")
     if &shellxquote == "'"
-      let s:rubypath = system('ruby -e "print $:.join(%q{,})"' )
+      let s:rubypath = system('ruby -e "print (begin; require %q{rubygems}; Gem.all_load_paths; rescue LoadError; []; end + $:).join(%q{,})"')
     else
-      let s:rubypath = system("ruby -e 'print $:.join(%q{,})'" )
+      let s:rubypath = system("ruby -e 'print (begin; require %q{rubygems}; Gem.all_load_paths; rescue LoadError; []; end + $:).join(%q{,})'")
     endif
     let s:rubypath = substitute(s:rubypath,',.$',',,','')
   else


More information about the vim-ruby-devel mailing list