From 5e057eea031316e2e5037101a0130bd44956de6f Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Oct 2012 09:39:38 +1030 Subject: [PATCH 1/2] WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. at ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/rdoctask.rb --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index b36289a3..8410c180 100644 --- a/Rakefile +++ b/Rakefile @@ -35,7 +35,7 @@ rescue LoadError puts "Hiding spec tasks because RSpec is not available" end -require 'rake/rdoctask' +require 'rdoc/task' Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" From c2a7c5690fa94b1ff357e19d7947f46fd3de74a4 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Tue, 16 Oct 2012 09:49:15 +1030 Subject: [PATCH 2/2] Fix https://github.com/rubycas/rubycas-client-rails/issues/20 for 1.8.7 --- lib/casclient/client.rb | 13 +++++++++++-- spec/casclient/client_spec.rb | 8 ++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/casclient/client.rb b/lib/casclient/client.rb index c69e7065..7845d13a 100644 --- a/lib/casclient/client.rb +++ b/lib/casclient/client.rb @@ -282,9 +282,18 @@ def hash_to_query(hash) pairs = [] hash.each do |k, vals| vals = [vals] unless vals.kind_of? Array - vals.each {|v| pairs << (v.nil? ? CGI.escape(k) : "#{CGI.escape(k)}=#{CGI.escape(v)}")} + + vals.each {|v| + if v.nil? + pairs << CGI.escape(k) unless k.nil? + else + pairs << "#{CGI.escape(k)}=#{CGI.escape(v)}" + end + + pairs + } end pairs.join("&") end end -end +end \ No newline at end of file diff --git a/spec/casclient/client_spec.rb b/spec/casclient/client_spec.rb index 98a52ac3..414bc184 100644 --- a/spec/casclient/client_spec.rb +++ b/spec/casclient/client_spec.rb @@ -90,4 +90,12 @@ end end end + + describe 'logout_url' do + it 'should tolerate oddly formed URIs' do + destination_url = 'https://foo.com/path/to/page?&sort=date_received.DESC' + + client.logout_url(destination_url) + end + end end