summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-06-19 12:34:34 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-06-19 12:34:34 +0000
commitbeabfb331bd384985a2e4d5c06ba54a3c7a33294 (patch)
treec0b542749011c931d34efee9e5574bcd6849d764
parentFixing #321595 and added dependency for plugin. (diff)
downloadgentoo-2-beabfb331bd384985a2e4d5c06ba54a3c7a33294.tar.gz
gentoo-2-beabfb331bd384985a2e4d5c06ba54a3c7a33294.tar.bz2
gentoo-2-beabfb331bd384985a2e4d5c06ba54a3c7a33294.zip
Version bump, new ebuild needs multi_json (and a fixed one) and is further fixed.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
-rw-r--r--dev-ruby/oauth2/ChangeLog9
-rw-r--r--dev-ruby/oauth2/files/oauth2-0.0.9-gentoo.patch65
-rw-r--r--dev-ruby/oauth2/oauth2-0.0.9.ebuild28
3 files changed, 101 insertions, 1 deletions
diff --git a/dev-ruby/oauth2/ChangeLog b/dev-ruby/oauth2/ChangeLog
index bcc9d0617f32..3227e84cd7fd 100644
--- a/dev-ruby/oauth2/ChangeLog
+++ b/dev-ruby/oauth2/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-ruby/oauth2
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/oauth2/ChangeLog,v 1.4 2010/05/18 18:45:34 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/oauth2/ChangeLog,v 1.5 2010/06/19 12:34:34 flameeyes Exp $
+
+*oauth2-0.0.9 (19 Jun 2010)
+
+ 19 Jun 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+ +oauth2-0.0.9.ebuild, +files/oauth2-0.0.9-gentoo.patch:
+ Version bump, new ebuild needs multi_json (and a fixed one) and is further
+ fixed.
18 May 2010; Diego E. Pettenò <flameeyes@gentoo.org> oauth2-0.0.8.ebuild:
Add ~x86, tested on development container.
diff --git a/dev-ruby/oauth2/files/oauth2-0.0.9-gentoo.patch b/dev-ruby/oauth2/files/oauth2-0.0.9-gentoo.patch
new file mode 100644
index 000000000000..fb27f0371530
--- /dev/null
+++ b/dev-ruby/oauth2/files/oauth2-0.0.9-gentoo.patch
@@ -0,0 +1,65 @@
+diff --git a/Rakefile b/Rakefile
+index e4b0361..983d568 100644
+--- a/Rakefile
++++ b/Rakefile
+@@ -16,10 +16,13 @@ begin
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+ Jeweler::GemcutterTasks.new
++
++ task :spec => :check_dependencies
+ rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+ end
+
++begin
+ require 'spec/rake/spectask'
+ Spec::Rake::SpecTask.new(:spec) do |spec|
+ spec.libs << 'lib' << 'spec'
+@@ -32,9 +35,10 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
+ spec.rcov = true
+ end
+
+-task :spec => :check_dependencies
+-
+ task :default => :spec
++rescue LoadError
++ puts "RSpec (or a dependency) not available. Install it with: gem install rspec"
++end
+
+ require 'rake/rdoctask'
+ Rake::RDocTask.new do |rdoc|
+diff --git a/lib/oauth2/strategy/web_server.rb b/lib/oauth2/strategy/web_server.rb
+index f8aa562..25bd5a9 100644
+--- a/lib/oauth2/strategy/web_server.rb
++++ b/lib/oauth2/strategy/web_server.rb
+@@ -13,7 +13,14 @@ module OAuth2
+ # endpoints.
+ def get_access_token(code, options = {})
+ response = @client.request(:post, @client.access_token_url, access_token_params(code, options))
+- params = MultiJson.decode(response) rescue Rack::Utils.parse_query(response)
++
++ params = MultiJson.decode(response) rescue nil
++ # the ActiveSupport JSON parser won't cause an exception when
++ # given a formencoded string, so make sure that it was
++ # actually parsed in an Hash. This covers even the case where
++ # it caused an exception since it'll still be nil.
++ params = Rack::Utils.parse_query(response) unless params.is_a? Hash
++
+ access = params['access_token']
+ refresh = params['refresh_token']
+ expires_in = params['expires_in']
+diff --git a/spec/oauth2/strategy/web_server_spec.rb b/spec/oauth2/strategy/web_server_spec.rb
+index aee0b76..14c5008 100644
+--- a/spec/oauth2/strategy/web_server_spec.rb
++++ b/spec/oauth2/strategy/web_server_spec.rb
+@@ -34,8 +34,8 @@ describe OAuth2::Strategy::WebServer do
+ end
+ end
+
+- describe "#get_access_token" do
+ %w(json formencoded).each do |mode|
++ describe "#get_access_token (#{mode})" do
+ before do
+ @mode = mode
+ @access = subject.get_access_token('sushi')
diff --git a/dev-ruby/oauth2/oauth2-0.0.9.ebuild b/dev-ruby/oauth2/oauth2-0.0.9.ebuild
new file mode 100644
index 000000000000..3397f2dbc5d1
--- /dev/null
+++ b/dev-ruby/oauth2/oauth2-0.0.9.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/oauth2/oauth2-0.0.9.ebuild,v 1.1 2010/06/19 12:34:34 flameeyes Exp $
+
+EAPI="2"
+
+USE_RUBY="ruby18 ruby19 jruby"
+
+RUBY_FAKEGEM_TASK_TEST="spec"
+RUBY_FAKEGEM_TASK_DOC="rerdoc"
+
+RUBY_FAKEGEM_DOCDIR="rdoc"
+RUBY_FAKEGEM_EXTRADOC="README.rdoc CHANGELOG.rdoc"
+
+inherit ruby-fakegem eutils
+
+DESCRIPTION="Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth gem."
+HOMEPAGE="http://github.com/intridea/oauth2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+ruby_add_rdepend "dev-ruby/faraday >=dev-ruby/multi_json-0.0.3-r1"
+ruby_add_bdepend test ">=dev-ruby/rspec-1.2.9"
+
+RUBY_PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )