Browse files

Improve 'compile' Rake task.

- Use the 'ruby' method to run extconf.rb, instead of calling the ruby
  command directly. This allows Rake to run extconf.rb in the same Ruby
  interpreter that was used to invoke Rake. This is useful if there are
  multiple Ruby installations, and not all of them are called 'ruby'.
- Use 'sh' instead of 'system' to run commands so that failed commands will
  properly abort the Rake task.

Signed-off-by: Coda Hale <>
  • Loading branch information...
1 parent fb7906c commit f01304abbeb445a3710fb3e15e69dee1b4637519 @FooBarWidget FooBarWidget committed with Aug 4, 2009
Showing with 4 additions and 4 deletions.
  1. +4 −4 Rakefile
@@ -83,10 +83,10 @@ end
desc "Clean, then compile the extension."
task :compile => [:clean] do
- Dir.chdir('./ext')
- system "ruby extconf.rb"
- system "make"
- Dir.chdir('..')
+ Dir.chdir('ext') do
+ ruby "extconf.rb"
+ sh "make"
+ end
desc "Run a set of benchmarks on the compiled extension."

0 comments on commit f01304a

Please sign in to comment.