Class: LibGems::Ext::RakeBuilder
- Defined in:
- lib/libgems/ext/rake_builder.rb
Class Method Summary collapse
Methods inherited from Builder
class_name, make, redirector, run
Class Method Details
.build(extension, directory, dest_path, results) ⇒ Object
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 # Deal with possible spaces in the path, e.g. C:/Program Files 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}" # ENV is frozen run cmd, results results end |