diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/lib/rubygems/ext/rake_builder.rb |
Fresh start
Diffstat (limited to 'jni/ruby/lib/rubygems/ext/rake_builder.rb')
-rw-r--r-- | jni/ruby/lib/rubygems/ext/rake_builder.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/jni/ruby/lib/rubygems/ext/rake_builder.rb b/jni/ruby/lib/rubygems/ext/rake_builder.rb new file mode 100644 index 0000000..d5ebf59 --- /dev/null +++ b/jni/ruby/lib/rubygems/ext/rake_builder.rb @@ -0,0 +1,36 @@ +#-- +# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. +# All rights reserved. +# See LICENSE.txt for permissions. +#++ + +class Gem::Ext::RakeBuilder < Gem::Ext::Builder + + def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil) + if File.basename(extension) =~ /mkrf_conf/i then + cmd = "#{Gem.ruby} #{File.basename extension}" + cmd << " #{args.join " "}" unless args.empty? + run cmd, results + end + + # Deal with possible spaces in the path, e.g. C:/Program Files + dest_path = '"' + dest_path.to_s + '"' if dest_path.to_s.include?(' ') + + rake = ENV['rake'] + + rake ||= begin + "#{Gem.ruby} -rubygems #{Gem.bin_path('rake', 'rake')}" + rescue Gem::Exception + end + + rake ||= Gem.default_exec_format % 'rake' + + cmd = "#{rake} RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}" # ENV is frozen + + run cmd, results + + results + end + +end + |