From f49276a982defff7a4c7d524c9bac44602b2204d Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 9 Oct 2011 20:30:13 +0200 Subject: [PATCH 1/3] 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 From 1b33a2733a9fdf708b1fbb562adaa696805527e9 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 9 Oct 2011 20:30:26 +0200 Subject: [PATCH 2/3] slight syntax issue with 1.9 --- app/helpers/todos_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 3f512309..2f3ef48e 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -123,7 +123,7 @@ module TodosHelper end def tag_span (tag, mobile=false) - content_tag(:span, :class => "tag #{tag.name.gsub(' ','-')}") { link_to (tag.name, mobile ? mobile_tag_path(tag.name) : tag_path(tag.name)) } + content_tag(:span, :class => "tag #{tag.name.gsub(' ','-')}") { link_to(tag.name, (mobile ? mobile_tag_path(tag.name) : tag_path(tag.name))) } end def tag_list(todo=@todo, mobile=false) From 4b0087ae36a42eb40b687009c8c78ec320d7283b Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 9 Oct 2011 20:30:48 +0200 Subject: [PATCH 3/3] fix path concatenation --- test/functional/feedlist_controller_test.rb | 2 +- test/functional/notes_controller_test.rb | 2 +- test/functional/preferences_controller_test.rb | 2 +- test/functional/projects_controller_test.rb | 4 ++-- test/functional/recurring_todos_controller_test.rb | 2 +- test/functional/stats_controller_test.rb | 2 +- test/functional/todos_controller_test.rb | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/functional/feedlist_controller_test.rb b/test/functional/feedlist_controller_test.rb index aa1d4326..372c5048 100644 --- a/test/functional/feedlist_controller_test.rb +++ b/test/functional/feedlist_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'feedlist_controller' # Re-raise errors caught by the controller. diff --git a/test/functional/notes_controller_test.rb b/test/functional/notes_controller_test.rb index 15510555..f03eb896 100644 --- a/test/functional/notes_controller_test.rb +++ b/test/functional/notes_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'notes_controller' # Re-raise errors caught by the controller. diff --git a/test/functional/preferences_controller_test.rb b/test/functional/preferences_controller_test.rb index 13d478b9..6c832994 100644 --- a/test/functional/preferences_controller_test.rb +++ b/test/functional/preferences_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'preferences_controller' # Re-raise errors caught by the controller. diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 32729605..a7220667 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -1,5 +1,5 @@ -require File.dirname(__FILE__) + '/../test_helper' -require File.dirname(__FILE__) + '/todo_container_controller_test_base' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') +require File.expand_path(File.dirname(__FILE__) + '/todo_container_controller_test_base') require 'projects_controller' # Re-raise errors caught by the controller. diff --git a/test/functional/recurring_todos_controller_test.rb b/test/functional/recurring_todos_controller_test.rb index b6f60d55..725c79ce 100644 --- a/test/functional/recurring_todos_controller_test.rb +++ b/test/functional/recurring_todos_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') class RecurringTodosControllerTest < ActionController::TestCase fixtures :users, :preferences, :projects, :contexts, :todos, :tags, :taggings, :recurring_todos diff --git a/test/functional/stats_controller_test.rb b/test/functional/stats_controller_test.rb index a187b79e..44ca1575 100755 --- a/test/functional/stats_controller_test.rb +++ b/test/functional/stats_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'stats_controller' # Re-raise errors caught by the controller. diff --git a/test/functional/todos_controller_test.rb b/test/functional/todos_controller_test.rb index 933b52d1..1abdfadc 100644 --- a/test/functional/todos_controller_test.rb +++ b/test/functional/todos_controller_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'todos_controller' # Re-raise errors caught by the controller.