Permalink
Browse files

update CommandT build process

  • Loading branch information...
1 parent bc3042c commit 37716d1bfdffb9fa4faac7664da8406914c2f582 @mislav committed Nov 29, 2011
Showing with 8 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +7 −3 Rakefile
View
@@ -1,3 +1,4 @@
/_temp
/_backup
/doc/tags
+.netrwhist
View
@@ -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

0 comments on commit 37716d1

Please sign in to comment.