12: def self.build(extension, directory, dest_path, results)
13: if File.basename(extension) =~ /mkrf_conf/i then
14: cmd = "#{Gem.ruby} #{File.basename extension}"
15: cmd << " #{Gem::Command.build_args.join " "}" unless Gem::Command.build_args.empty?
16: run cmd, results
17: end
18:
19:
20: dest_path = '"' + dest_path + '"' if dest_path.include?(' ')
21:
22: rake = ENV['rake']
23:
24: rake ||= begin
25: "\"#{Gem.ruby}\" -rubygems #{Gem.bin_path('rake', 'rake')}"
26: rescue Gem::Exception
27: end
28:
29: rake ||= Gem.default_exec_format % 'rake'
30:
31: cmd = "#{rake} RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}"
32:
33: run cmd, results
34:
35: results
36: end