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
|
# File 'lib/libgems/ext/rake_builder.rb', line 12
def self.build(extension, directory, dest_path, results)
if File.basename(extension) =~ /mkrf_conf/i then
cmd = "#{LibGems.ruby} #{File.basename extension}"
cmd << " #{LibGems::Command.build_args.join " "}" unless LibGems::Command.build_args.empty?
run cmd, results
end
dest_path = '"' + dest_path + '"' if dest_path.include?(' ')
rake = ENV['rake']
rake ||= begin
"\"#{LibGems.ruby}\" -rubygems #{LibGems.bin_path('rake')}"
rescue LibGems::Exception
end
rake ||= LibGems.default_exec_format % 'rake'
cmd = "#{rake} RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}"
run cmd, results
results
end
|