diff options
author | 2012-01-25 02:19:47 +0000 | |
---|---|---|
committer | 2012-01-25 02:19:47 +0000 | |
commit | 21313f635e5b38b7c4b8fb3a589a2846f1319221 (patch) | |
tree | df98f953a8a4a5e73b9bc18ab142ec090653d7be /dev-ruby/builder | |
parent | Migrate to EAPI=4, fix build with newer automake with patch from upstream, ad... (diff) | |
download | gentoo-2-21313f635e5b38b7c4b8fb3a589a2846f1319221.tar.gz gentoo-2-21313f635e5b38b7c4b8fb3a589a2846f1319221.tar.bz2 gentoo-2-21313f635e5b38b7c4b8fb3a589a2846f1319221.zip |
Fix conflict with fast_xs/hpricot and fix failing tests with Ruby 1.9.3.
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/builder')
-rw-r--r-- | dev-ruby/builder/ChangeLog | 10 | ||||
-rw-r--r-- | dev-ruby/builder/builder-3.0.0-r1.ebuild | 33 | ||||
-rw-r--r-- | dev-ruby/builder/files/builder-3.0.0-tests.patch | 55 |
3 files changed, 96 insertions, 2 deletions
diff --git a/dev-ruby/builder/ChangeLog b/dev-ruby/builder/ChangeLog index 1ade37880fbb..861ff9ac5e26 100644 --- a/dev-ruby/builder/ChangeLog +++ b/dev-ruby/builder/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-ruby/builder -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-ruby/builder/ChangeLog,v 1.64 2011/12/31 18:39:56 grobian Exp $ +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/builder/ChangeLog,v 1.65 2012/01/25 02:19:47 flameeyes Exp $ + +*builder-3.0.0-r1 (25 Jan 2012) + + 25 Jan 2012; Diego E. Pettenò <flameeyes@gentoo.org> +builder-3.0.0-r1.ebuild, + +files/builder-3.0.0-tests.patch: + Fix conflict with fast_xs/hpricot and fix failing tests with Ruby 1.9.3. 31 Dec 2011; Fabian Groffen <grobian@gentoo.org> builder-3.0.0.ebuild: Add Prefix keywords, bug #396547 diff --git a/dev-ruby/builder/builder-3.0.0-r1.ebuild b/dev-ruby/builder/builder-3.0.0-r1.ebuild new file mode 100644 index 000000000000..ae388f49b8e5 --- /dev/null +++ b/dev-ruby/builder/builder-3.0.0-r1.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/builder/builder-3.0.0-r1.ebuild,v 1.1 2012/01/25 02:19:47 flameeyes Exp $ + +EAPI=2 +USE_RUBY="ruby18 ruby19 ree18 jruby" + +RUBY_FAKEGEM_TASK_TEST="test_all" + +RUBY_FAKEGEM_DOCDIR="doc" +RUBY_FAKEGEM_EXTRADOC="README CHANGES" + +inherit ruby-fakegem eutils + +DESCRIPTION="A builder to facilitate programatic generation of XML markup" +HOMEPAGE="http://rubyforge.org/projects/builder/" + +LICENSE="MIT" +SLOT="3" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="" + +ruby_add_bdepend "test? ( virtual/ruby-test-unit )" + +all_ruby_prepare() { + sed -i -e '/rdoc\.template .*jamis/d' Rakefile || die + + # Remove file that should not be part of the distribution. + rm test/test_cssbuilder.rb || die + + epatch "${FILESDIR}"/${P}+ruby-1.9.2.patch + epatch "${FILESDIR}"/${P}-tests.patch +} diff --git a/dev-ruby/builder/files/builder-3.0.0-tests.patch b/dev-ruby/builder/files/builder-3.0.0-tests.patch new file mode 100644 index 000000000000..04eb16228db9 --- /dev/null +++ b/dev-ruby/builder/files/builder-3.0.0-tests.patch @@ -0,0 +1,55 @@ +diff --git a/lib/builder/xmlbase.rb b/lib/builder/xmlbase.rb +index 1a1e5f9..06f8807 100644 +--- a/lib/builder/xmlbase.rb ++++ b/lib/builder/xmlbase.rb +@@ -122,7 +122,9 @@ module Builder + def _escape(text) + result = XChar.encode(text) + begin +- result.encode(@encoding) ++ encoding = ::Encoding::find(@encoding) ++ raise Exception if encoding.dummy? ++ result.encode(encoding) + rescue + # if the encoding can't be supported, use numeric character references + result. +@@ -132,7 +134,12 @@ module Builder + end + else + def _escape(text) +- text.to_xs((@encoding != 'utf-8' or $KCODE != 'UTF8')) ++ # original_xs is defined by activesupport when fast_xs is ++ # loaded; since fast_xs (as of version 0.8.0) does not accept ++ # the encode parameter, use the original function if present. ++ toxs_method = ::String.method_defined?(:original_xs) ? :original_xs : :to_xs ++ ++ text.send(toxs_method, (@encoding != 'utf-8' or $KCODE != 'UTF8')) + end + end + +diff --git a/test/test_markupbuilder.rb b/test/test_markupbuilder.rb +index 63864ad..2d9b853 100644 +--- a/test/test_markupbuilder.rb ++++ b/test/test_markupbuilder.rb +@@ -446,13 +446,20 @@ class TestIndentedXmlMarkup < Test::Unit::TestCase + end + end + +- def test_use_entities_if_kcode_is_utf_but_encoding_is_something_else ++ def test_use_entities_if_kcode_is_utf_but_encoding_is_dummy_encoding + xml = Builder::XmlMarkup.new + xml.instruct!(:xml, :encoding => 'UTF-16') + xml.p(encode("\xE2\x80\x99", 'UTF8')) + assert_match(%r(<p>’</p>), xml.target!) # + end + ++ def test_use_entities_if_kcode_is_utf_but_encoding_is_unsupported_encoding ++ xml = Builder::XmlMarkup.new ++ xml.instruct!(:xml, :encoding => 'UCS-2') ++ xml.p(encode("\xE2\x80\x99", 'UTF8')) ++ assert_match(%r(<p>’</p>), xml.target!) # ++ end ++ + def test_use_utf8_if_encoding_defaults_and_kcode_is_utf8 + xml = Builder::XmlMarkup.new + xml.p(encode("\xE2\x80\x99",'UTF8')) |