From c3669b1de715164e6f8b44ba13a34ff30d368c9e Mon Sep 17 00:00:00 2001 From: Tim Harper Date: Thu, 26 May 2011 14:54:28 -0600 Subject: [PATCH] remove conditional dependency installation code, and consequently, the rake dependency --- ext/mkrf_conf.rb | 26 -------------------------- lib/spork/run_strategy/magazine.rb | 9 ++++++++- spork.gemspec | 1 - 3 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 ext/mkrf_conf.rb diff --git a/ext/mkrf_conf.rb b/ext/mkrf_conf.rb deleted file mode 100644 index 6ed6619..0000000 --- a/ext/mkrf_conf.rb +++ /dev/null @@ -1,26 +0,0 @@ -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" -inst = Gem::DependencyInstaller.new - -# this will fail if rake isn't installed. -begin - inst.install "rake" -rescue - # oh well. Let it fail later. -end - -if RUBY_PLATFORM =~ /mswin|mingw/ and RUBY_VERSION < '1.9.1' - STDERR.puts "installing windows dependencies" - begin - inst.install "win32-process", "~> 0.6.1" - rescue => e - STDERR.puts "Failed to install necessary dependency gem win32-process: #{e}" - exit(1) - end -end - -f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success -f.write("task :default\n") -f.close diff --git a/lib/spork/run_strategy/magazine.rb b/lib/spork/run_strategy/magazine.rb index eaa820c..c0b4248 100755 --- a/lib/spork/run_strategy/magazine.rb +++ b/lib/spork/run_strategy/magazine.rb @@ -3,7 +3,14 @@ # as they come in require 'drb' require 'rinda/ring' -require 'win32/process' if RUBY_PLATFORM =~ /mswin|mingw/ and RUBY_VERSION < '1.9.1' +if RUBY_PLATFORM =~ /mswin|mingw/ and RUBY_VERSION < '1.9.1' + begin + require 'win32/process' + rescue LoadError + puts "The 'win32-process' gem is required for windows Spork support with ruby 1.9.1 and lower. Install it, or if using bundler, add it to your Gemfile." + end +end + require 'rubygems' # used for Gem.ruby $:.unshift(File.dirname(__FILE__)) diff --git a/spork.gemspec b/spork.gemspec index 17b0340..5452416 100644 --- a/spork.gemspec +++ b/spork.gemspec @@ -13,7 +13,6 @@ Gem::Specification.new do |s| "MIT-LICENSE", "README.rdoc" ] - s.extensions = 'ext/mkrf_conf.rb' s.files = ["Gemfile", "README.rdoc", "MIT-LICENSE"] + Dir["lib/**/*"] + Dir["assets/**/*"] s.homepage = %q{http://github.com/timcharper/spork} s.rdoc_options = ["--main", "README.rdoc"]