Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update CommandT build process

  • Loading branch information...
commit 37716d1bfdffb9fa4faac7664da8406914c2f582 1 parent bc3042c
@mislav authored
Showing with 8 additions and 3 deletions.
  1. +1 −0  .gitignore
  2. +7 −3 Rakefile
View
1  .gitignore
@@ -1,3 +1,4 @@
/_temp
/_backup
/doc/tags
+.netrwhist
View
10 Rakefile
@@ -23,9 +23,13 @@ end
task :command_t do
puts "Compiling Command-T plugin..."
Dir.chdir "bundle/command-t/ruby/command-t" do
- ruby = %w[/usr/bin/ruby1.8 /usr/bin/ruby].find {|rb| File.executable? rb } || 'ruby'
- rbenv = {'RBENV_VERSION' => 'system'}
- sh rbenv, ruby, 'extconf.rb'
+ # first try to read which ruby version is vim compiled against
+ read_version = %{require "rbconfig"; print File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["ruby_install_name"])}
+ ruby = `vim --cmd 'ruby #{read_version}' --cmd 'q' 2>&1 >/dev/null | grep -v 'Vim: Warning'`.strip
+ # fall back to system rubies
+ ruby = %w[/usr/bin/ruby1.8 /usr/bin/ruby].find {|rb| File.executable? rb } || 'ruby' if ruby.empty?
+ cmd = Array(ruby) + %w[extconf.rb]
+ sh(*cmd)
sh "make clean && make"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.