diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-06-28 17:52:31 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-06-28 17:52:31 +0000 |
commit | 856ae18016f3884766ada276e8412e1c993323ae (patch) | |
tree | f8d00fc0bb7060b9067a6c1be680b855886d6c66 /dev-ruby | |
parent | Bump to 3.0v (actually v2), small changes in emake call to fix tests failing ... (diff) | |
download | gentoo-2-856ae18016f3884766ada276e8412e1c993323ae.tar.gz gentoo-2-856ae18016f3884766ada276e8412e1c993323ae.tar.bz2 gentoo-2-856ae18016f3884766ada276e8412e1c993323ae.zip |
Backport a patch applied by Typo upstream.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby')
-rw-r--r-- | dev-ruby/flickr/ChangeLog | 8 | ||||
-rw-r--r-- | dev-ruby/flickr/files/flickr-1.0.2-typo.patch | 37 | ||||
-rw-r--r-- | dev-ruby/flickr/flickr-1.0.2-r2.ebuild | 56 |
3 files changed, 100 insertions, 1 deletions
diff --git a/dev-ruby/flickr/ChangeLog b/dev-ruby/flickr/ChangeLog index fd60ee3e8f35..eeea3c20a933 100644 --- a/dev-ruby/flickr/ChangeLog +++ b/dev-ruby/flickr/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-ruby/flickr # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/flickr/ChangeLog,v 1.6 2009/06/20 11:44:54 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/flickr/ChangeLog,v 1.7 2009/06/28 17:52:31 flameeyes Exp $ + +*flickr-1.0.2-r2 (28 Jun 2009) + + 28 Jun 2009; Diego E. Pettenò <flameeyes@gentoo.org> + +flickr-1.0.2-r2.ebuild, +files/flickr-1.0.2-typo.patch: + Backport a patch applied by Typo upstream. 20 Jun 2009; Diego E. Pettenò <flameeyes@gentoo.org> -flickr-1.0.2.ebuild: diff --git a/dev-ruby/flickr/files/flickr-1.0.2-typo.patch b/dev-ruby/flickr/files/flickr-1.0.2-typo.patch new file mode 100644 index 000000000000..0a54953398cb --- /dev/null +++ b/dev-ruby/flickr/files/flickr-1.0.2-typo.patch @@ -0,0 +1,37 @@ +Author: Frédéric de Villamil <frederic@de-villamil.com> +Date: Sun Jun 28 15:01:05 2009 +0200 + + Fixing a bug where vendor/flickr/flickr.rb could not handle 302 response. Closes ticket #106 + +diff --git a/vendor/flickr/flickr.rb b/vendor/flickr/flickr.rb +index 4728132..a5e5352 100644 +--- a/vendor/flickr/flickr.rb ++++ b/vendor/flickr/flickr.rb +@@ -45,8 +45,8 @@ + # - make a kickass demo, including autocompleting-ajax photo lookup ala http://mir.aculo.us/images/autocomplete1.mov + + require 'cgi' +-require 'net/http' ++require 'open-uri' + require 'xmlsimple' + + # Flickr client class. Requires an API key, and optionally takes an email and password for authentication + class Flickr +@@ -78,7 +78,7 @@ class Flickr + + # Does an HTTP GET on a given URL and returns the response body + def http_get(url) +- Net::HTTP.get_response(URI.parse(url)).body.to_s ++ open(URI.parse(url)) {|h| h.read } + end + + # Stores authentication credentials to use on all subsequent calls. +@@ -318,7 +318,7 @@ class Flickr + + # Returns the photo file data itself, in any specified size. Example: File.open(photo.title, 'w') { |f| f.puts photo.file } + def file(size='Medium') +- Net::HTTP.get_response(URI.parse(source(size))).body ++ open(URI.parse(source(size))) {|h| h.read } + end + + # Unique filename for the image, based on the Flickr NSID diff --git a/dev-ruby/flickr/flickr-1.0.2-r2.ebuild b/dev-ruby/flickr/flickr-1.0.2-r2.ebuild new file mode 100644 index 000000000000..90425bfa8f51 --- /dev/null +++ b/dev-ruby/flickr/flickr-1.0.2-r2.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/flickr/flickr-1.0.2-r2.ebuild,v 1.1 2009/06/28 17:52:31 flameeyes Exp $ + +inherit ruby eutils + +DESCRIPTION="An insanely easy interface to the Flickr photo-sharing service." +HOMEPAGE="http://rubyforge.org/projects/flickr/" +SRC_URI="mirror://gentoo/${P}-gentoo.tar.bz2" + +S="${WORKDIR}/${P}-gentoo" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="test doc" + +# Tests fail for now, they don't seem to be designed to work just yet +RESTRICT="test" + +RDEPEND="dev-ruby/xml-simple" +DEPEND=" + test? ( dev-ruby/rake + dev-ruby/rubygems ) + doc? ( dev-ruby/rake + dev-ruby/rubygems )" + +USE_RUBY="ruby18" + +src_unpack() { + unpack ${A} + + cd "${S}"/lib + epatch "${FILESDIR}/${P}-fix.patch" + epatch "${FILESDIR}/${P}-typo.patch" +} + +src_compile() { + if use doc; then + rake rdoc || die "rake rdoc failed" + fi +} + +src_install() { + cd "${S}"/lib + doruby -r * || die "doruby failed" + + if use doc; then + dohtml -r "${S}"/doc/* || die "dohtml failed" + fi + + dohtml "${S}"/index.html || die "dohtml failed" + + insinto $(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]')/../gems/1.8/specifications + doins "${S}"/${P}.gemspec || die "Unable to install fake gemspec" +} |