Hi list.
I updated rubygems, then I got an error while opening *.rb file always.
It seems some method become deprecated.
Below is a patch that use fallback using Gem::Specification.
Please check and include.
This patch change expression of &shellxquote == "'" to &shellxquote != '"'.
shellxquote can set empty value on windows. It have better to
use &shellxquote != '"'.
Thanks.
- Yasuhiro Matsumoto
diff -r 1d1065c2e7fa runtime/ftplugin/ruby.vim
--- a/runtime/ftplugin/ruby.vim Wed Jul 20 18:29:39 2011 +0200
+++ b/runtime/ftplugin/ruby.vim Thu Jul 21 20:34:19 2011 +0900
@@ -73,11 +73,11 @@
if exists("g:ruby_path")
let s:ruby_path = g:ruby_path
elseif has("ruby") && has("win32")
- ruby VIM::command( 'let s:ruby_path = "%s"' % ($: + begin; require
%q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; [];
end).join(%q{,}) )
+ ruby VIM::command( 'let s:ruby_path = "%s"' % ($: + begin; require
%q{rubygems}; Gem.all_load_paths.sort.uniq; rescue NoMethodError;
Gem::Specification.map{|s|s.gem_dir}.sort.uniq; rescue LoadError; [];
end).join(%q{,}) )
let s:ruby_path = '.,' . substitute(s:ruby_path,
'\%(^\|,\)\.\%(,\|$\)', ',,', '')
elseif executable("ruby")
- let s:code = "print ($: + begin; require %q{rubygems};
Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,})"
- if &shellxquote == "'"
+ let s:code = "print ($: + begin; require %q{rubygems};
Gem.all_load_paths.sort.uniq; rescue NoMethodError;
Gem::Specification.map{|s|s.gem_dir}.sort.uniq; rescue LoadError; [];
end).join(%q{,})"
+ if &shellxquote != '"'
let s:ruby_path = system('ruby -e "' . s:code . '"')
else
let s:ruby_path = system("ruby -e '" . s:code . "'")
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php