summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext/rake_builder.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-10 07:48:56 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-10 07:48:56 +0000
commitfbf59bdbea63efd34ccc144e648467d2f52e7345 (patch)
tree244f0e7ae112cc7dd135e5d1ac24e6c70ba71b4a /lib/rubygems/ext/rake_builder.rb
parent7a4aad75356496559460041a6c063bdb736c7236 (diff)
Import RubyGems trunk revision 1493.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/ext/rake_builder.rb')
-rw-r--r--lib/rubygems/ext/rake_builder.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb
new file mode 100644
index 0000000000..3772f6a00f
--- /dev/null
+++ b/lib/rubygems/ext/rake_builder.rb
@@ -0,0 +1,27 @@
+#--
+# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
+# All rights reserved.
+# See LICENSE.txt for permissions.
+#++
+
+require 'rubygems/ext/builder'
+
+class Gem::Ext::RakeBuilder < Gem::Ext::Builder
+
+ def self.build(extension, directory, dest_path, results)
+ if File.basename(extension) =~ /mkrf_conf/i then
+ cmd = "#{Gem.ruby} #{File.basename extension}"
+ cmd << " #{ARGV.join " "}" unless ARGV.empty?
+ run cmd, results
+ end
+
+ cmd = ENV['rake'] || 'rake'
+ cmd << " RUBYARCHDIR=#{dest_path} RUBYLIBDIR=#{dest_path}"
+
+ run cmd, results
+
+ results
+ end
+
+end
+