fix one deprecation warning for rubygems >= 1.8.2

This commit is contained in:
Reinier Balt 2011-09-09 22:02:02 +02:00
parent 998231066f
commit 30c2fb8b82

View file

@ -1,6 +1,15 @@
# adapted from https://gist.github.com/471663 and https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238
if Rails.version == '2.3.14' && Gem.available?('mongrel', '~>1.1.5') && self.class.const_defined?(:Mongrel)
def check_mongrel_around_115
# Gem.available? is deprecated from rubygems 1.8.2
Gem::Specification::find_by_name "mongrel", "~>1.1.5"
rescue
Gem.available?('mongrel', '~>1.1.5')
end
mongrel115 = check_mongrel_around_115
if Rails.version == '2.3.14' && mongrel115 && self.class.const_defined?(:Mongrel)
# Pulled right from latest rack. Old looked like this in 1.1.0 version.
#