Permalink
Browse files

adds file to automatically install Windows dependencies if using Windows

  • Loading branch information...
1 parent 2ec9a62 commit 64dedb09b670c1933ff126a30d2c750e8522166f @timcharper timcharper committed Mar 8, 2010
Showing with 19 additions and 0 deletions.
  1. +19 −0 ext/mkrf_conf.rb
View
@@ -0,0 +1,19 @@
+require 'rubygems'
+require 'rubygems/command.rb'
+require 'rubygems/dependency_installer.rb'
+STDERR.puts "Actually, there aren't any native extensions. I'm just dynamically installing dependencies based off of your operating system"
+begin
+ Gem::Command.build_args = ARGV
+ rescue NoMethodError
+end
+inst = Gem::DependencyInstaller.new
+begin
+ inst.install "rake"
+ inst.install "win32-process", "~> 0.6.1" if RUBY_PLATFORM =~ /mswin|mingw/
+rescue
+ exit(1)
+end
+
+f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
+f.write("task :default\n")
+f.close

1 comment on commit 64dedb0

@Milhouse
Contributor

Nice. I was just playing with a mkrf file today for compiling the rsruby gem native code.

Please sign in to comment.