From c79c3b786a56c5ff934bd8b663af2bcd2ca7e522 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Wed, 28 Apr 2010 02:22:58 -0300 Subject: [PATCH] Try loading versioned http parser first. Also, add the versioned directory to the clean task --- lib/mongrel.rb | 4 ++-- tasks/native.rake | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/mongrel.rb b/lib/mongrel.rb index eb659cb0..6c935b3f 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -11,10 +11,10 @@ require 'stringio' # Compiled Mongrel extension # support multiple ruby version (fat binaries under windows) begin - require 'http11' -rescue LoadError RUBY_VERSION =~ /(\d+.\d+)/ require "#{$1}/http11" +rescue LoadError + require 'http11' end # Gem conditional loader diff --git a/tasks/native.rake b/tasks/native.rake index 7a5107ef..4d5d71b3 100644 --- a/tasks/native.rake +++ b/tasks/native.rake @@ -7,10 +7,8 @@ Rake::ExtensionTask.new('http11', HOE.spec) do |ext| if RUBY_PLATFORM =~ /mingw|mswin/ then RUBY_VERSION =~ /(\d+\.\d+)/ ext.lib_dir = "lib/#{$1}" - end - - # define cross-compilation tasks when not on Windows. - unless RUBY_PLATFORM =~ /mingw|mswin/ then + else + # define cross-compilation tasks when not on Windows. ext.cross_compile = true ext.cross_platform = ['i386-mswin32', 'i386-mingw32'] @@ -18,6 +16,9 @@ Rake::ExtensionTask.new('http11', HOE.spec) do |ext| gs.dependencies.delete gs.dependencies.find { |d| d.name == 'daemons' } end end + + # cleanup versioned library directory + CLEAN.include 'lib/{1.8,1.9}' end # ensure things are built prior testing