Skip to content

Commit e667558

Browse files
Alireza Bashiritpope
authored andcommitted
Exclude rubygems in finding the default load path (#301)
Including RubyGems libraries in finding the Ruby's default load path is not necessary and it causes slow operation. * Use --disable-gems flag to make the operation fast
1 parent 01196b0 commit e667558

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

ftplugin/ruby.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@ function! s:query_path(root) abort
7575
let prefix = ''
7676
endif
7777
if &shellxquote == "'"
78-
let path_check = prefix.'ruby -e "' . code . '"'
78+
let path_check = prefix.'ruby -e --disable-gems"' . code . '"'
7979
else
80-
let path_check = prefix."ruby -e '" . code . "'"
80+
let path_check = prefix."ruby -e --disable-gems'" . code . "'"
8181
endif
8282

8383
let cd = haslocaldir() ? 'lcd' : 'cd'
84-
let cwd = getcwd()
84+
let cwd = fnameescape(getcwd())
8585
try
8686
exe cd fnameescape(a:root)
8787
let path = split(system(path_check),',')
88-
exe cd fnameescape(cwd)
88+
exe cd cwd
8989
return path
9090
finally
91-
exe cd fnameescape(cwd)
91+
exe cd cwd
9292
endtry
9393
endfunction
9494

0 commit comments

Comments
 (0)