summaryrefslogtreecommitdiffstats
path: root/vim/ftplugin/ruby.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/ftplugin/ruby.vim')
-rw-r--r--vim/ftplugin/ruby.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/vim/ftplugin/ruby.vim b/vim/ftplugin/ruby.vim
new file mode 100644
index 0000000..fa735f8
--- /dev/null
+++ b/vim/ftplugin/ruby.vim
@@ -0,0 +1,17 @@
+function! s:rubocop_in_bundler()
+ let gemfiles = glob("*.gemspec", 1, 1)
+ if filereadable("Gemfile")
+ let gemfiles += ["Gemfile"]
+ endif
+ for file in gemfiles
+ for line in readfile(file)
+ if line =~ 'gem.*rubocop'
+ return 1
+ endif
+ endfor
+ endfor
+ return 0
+endfunction
+if s:rubocop_in_bundler()
+ let b:ale_ruby_rubocop_executable = 'bundle'
+endif