Skip to content

Commit

Permalink
Support multiple Ruby version (fat binaries under windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
macournoyer committed Mar 1, 2010
1 parent fe31d80 commit 85e9ef5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -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/*
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions Rakefile
Expand Up @@ -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
Expand All @@ -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"]
10 changes: 10 additions & 0 deletions lib/thin.rb
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion lib/thin/request.rb
@@ -1,4 +1,3 @@
require "#{Thin::ROOT}/thin_parser"
require 'tempfile'

module Thin
Expand Down

0 comments on commit 85e9ef5

Please sign in to comment.