Package: ruby-mkrf / 0.2.3+dfsg-5

0400_use_correct_ruby_version_in_tests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: Use the same Ruby binary to run the tests and to create Rakefiles
 Gem2deb defines the RUBY_TEST_BIN environment variable. Use it to call the
 correct version of the Ruby binary during tests on extconf.rb to generate
 Rakefiles.
Author: C├ędric Boutillier <cedric.boutillier@gmail.com>
Last-Update: 2012-07-04

--- a/Rakefile
+++ b/Rakefile
@@ -18,6 +18,8 @@
 RUBY_FORGE_PROJECT = "mkrf"
 RUBY_FORGE_USER    = "kevinclark"
 
+RUBY_TEST_BIN = ENV['RUBY_TEST_BIN']
+
 
 task :default => ["test:units"]
 
@@ -55,22 +57,22 @@
     
     desc "Try to compile a trivial extension"
     task :trivial do
-      sh "cd #{SAMPLE_DIRS[:trivial]}; ruby extconf.rb; rake"
+      sh "cd #{SAMPLE_DIRS[:trivial]}; #{RUBY_TEST_BIN} extconf.rb; rake"
     end
     
     desc "Try to compile libxml"
     task :libxml do
-      sh "cd #{SAMPLE_DIRS[:libxml]}; ruby extconf.rb; rake"
+      sh "cd #{SAMPLE_DIRS[:libxml]}; #{RUBY_TEST_BIN} extconf.rb; rake"
     end
     
     desc "Try to compile syck"
     task :syck do
-      sh "cd #{SAMPLE_DIRS[:syck]}; ruby extconf.rb; rake"
+      sh "cd #{SAMPLE_DIRS[:syck]}; #{RUBY_TEST_BIN} extconf.rb; rake"
     end
     
     desc "Try to compile cpp_bang"
     task :cpp_bang do
-      sh "cd #{SAMPLE_DIRS[:cpp_bang]}; ruby mkrf_config.rb; rake"
+      sh "cd #{SAMPLE_DIRS[:cpp_bang]}; #{RUBY_TEST_BIN} mkrf_config.rb; rake"
     end
 
     desc "Clean up after sample tests"