From f49276a982defff7a4c7d524c9bac44602b2204d Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 9 Oct 2011 20:30:13 +0200 Subject: [PATCH] fixing gems for 1.9 --- Gemfile | 22 ++++++++++++++++------ app/controllers/backend_controller.rb | 1 + config/initializers/mongrel_workaround.rb | 14 ++++++++++---- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 6638f39b..82323258 100644 --- a/Gemfile +++ b/Gemfile @@ -4,30 +4,42 @@ source "http://gems.github.com/" gem "rake", "~>0.8.7" gem "rails", "~>2.3.12" gem "highline", "~>1.5.0" -gem "RedCloth", "4.2.3" -gem "soap4r", "~>1.5.8" +gem "RedCloth", "4.2.8" gem "sanitize", "~>1.2.1" gem "rack", "1.1.0" gem "will_paginate", "~> 2.3.15" gem "has_many_polymorphs", "~> 2.13" gem "acts_as_list", "~>0.1.4" gem "aasm", "~>2.2.0" -gem "actionwebservice", :git => "git://github.com/dejan/actionwebservice.git" +gem "rubyjedi-actionwebservice", :require => "actionwebservice" gem "rubycas-client", "~>2.2.1" gem "ruby-openid", :require => "openid" gem "sqlite3" gem 'bcrypt-ruby', '~> 2.1.4' gem 'htmlentities', '~> 4.3.0' +if RUBY_VERSION.to_f >= 1.9 + gem "soap4r-ruby1.9" +else + gem "soap4r", "~>1.5.8" +end + gem "webrat", ">=0.7.0", :groups => [:cucumber, :test] gem "database_cleaner", ">=0.5.0", :groups => [:cucumber, :selenium] gem "cucumber-rails", "~>0.3.0", :groups => :cucumber group :development do - gem "ruby-debug" + if RUBY_VERSION.to_f >= 1.9 + gem "ruby-debug19" + gem "mongrel", "1.2.0.pre2" + else + gem "ruby-debug" + gem "mongrel" + end end group :test do + gem "test-unit", "1.2.3" gem "flexmock" gem "ZenTest", ">=4.0.0" gem "hpricot" @@ -39,6 +51,4 @@ end group :selenium do gem "selenium-client" - gem "mongrel" end - diff --git a/app/controllers/backend_controller.rb b/app/controllers/backend_controller.rb index 5fceed53..0f84c649 100644 --- a/app/controllers/backend_controller.rb +++ b/app/controllers/backend_controller.rb @@ -1,6 +1,7 @@ class CannotAccessContext < RuntimeError; end class BackendController < ApplicationController + acts_as_web_service wsdl_service_name 'Backend' web_service_api TodoApi web_service_scaffold :invoke diff --git a/config/initializers/mongrel_workaround.rb b/config/initializers/mongrel_workaround.rb index a82a11ac..dcad6931 100644 --- a/config/initializers/mongrel_workaround.rb +++ b/config/initializers/mongrel_workaround.rb @@ -1,10 +1,16 @@ # adapted from https://gist.github.com/471663 and https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238 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') +begin + # Gem.available? is deprecated from rubygems 1.8.2 + Gem::Specification::find_by_name "mongrel", "~>1.1.5" + rescue Gem::LoadError + if RUBY_VERSION[2] == "9" + false + else + Gem.available?('mongrel', '~>1.1.5') + end + end end mongrel115 = check_mongrel_around_115