Permalink
Browse files

Support multiple Ruby version (fat binaries under windows)

  • Loading branch information...
1 parent fe31d80 commit 85e9ef55e57d85345b01ff224c5cb064605e0fc6 @macournoyer macournoyer committed Mar 1, 2010
Showing with 19 additions and 4 deletions.
  1. +1 −1 .gitignore
  2. +1 −0 CHANGELOG
  3. +7 −2 Rakefile
  4. +10 −0 lib/thin.rb
  5. +0 −1 lib/thin/request.rb
View
@@ -8,7 +8,7 @@ ext/thin_parser/*mswin32*
ext/thin_parser/vc60.pdb
ext/thin_parser/*.so
lib/*.bundle
-lib/*.so
+lib/*/**.so
log
spec/rails_app/log
doc/rdoc/*
View
@@ -1,4 +1,5 @@
== 1.2.7 No Hup
+ * Support multiple Ruby version (fat binaries under windows)
* Do not trap unsupported HUP signal on Windows
== 1.2.6 Crazy Delicious
View
@@ -23,7 +23,7 @@ Rake::ExtensionTask.new('thin_parser', Thin::GemSpec) do |ext|
ext.cross_platform = %w( i386-mswin32 x86-mingw32 )
end
-CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM)
+CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/*/Makefile ext/*/conftest.dSYM lib/1.{8,9}})
desc "Compile the Ragel state machines"
task :ragel do
@@ -35,5 +35,10 @@ task :ragel do
end
end
+desc "Build gem packages"
+task :gems do
+ sh "rake clean gem && rake cross native gem RUBY_CC_VERSION=1.8.6:1.9.1"
+end
+
desc "Release version #{Thin::VERSION::STRING} gems to rubyforge"
-task :release => [:clean, :cross, :native, :gem, :tag, "gem:push"]
+task :release => [:tag, "gem:push"]
View
@@ -39,6 +39,16 @@ module Controllers
require "#{Thin::ROOT}/thin/statuses"
require "#{Thin::ROOT}/rack/adapter/loader"
+# support multiple Ruby version (fat binaries under windows)
+begin
+ require "#{Thin::ROOT}/thin_parser"
+rescue LoadError
+ if RUBY_PLATFORM =~ /mingw|mswin/ then
+ RUBY_VERSION =~ /(\d+.\d+)/
+ require "#{Thin::ROOT}/#{$1}/thin_parser"
+ end
+end
+
module Rack
module Adapter
autoload :Rails, "#{Thin::ROOT}/rack/adapter/rails"
View
@@ -1,4 +1,3 @@
-require "#{Thin::ROOT}/thin_parser"
require 'tempfile'
module Thin

0 comments on commit 85e9ef5

Please sign in to comment.