Merge pull request #37 from 02strich/ruby-1.9

Ruby 1.9 compatibility
This commit is contained in:
Reinier Balt 2011-10-10 04:35:46 -07:00
commit 799a50b654
11 changed files with 36 additions and 19 deletions

22
Gemfile
View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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

View file

@ -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.

View file

@ -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.