dev-ruby/multi_xml: fix compat with ox > 2.4.11
authorHans de Graaff <graaff@gentoo.org>
Sun, 1 Jul 2018 08:24:43 +0000 (10:24 +0200)
committerHans de Graaff <graaff@gentoo.org>
Sun, 1 Jul 2018 08:25:12 +0000 (10:25 +0200)
Backport upstream pull requests approved by ox maintainer to fix
specs with ox > 2.4.11 and ensure more consistent options.

Closes: https://bugs.gentoo.org/640090
Package-Manager: Portage-2.3.40, Repoman-2.3.9

dev-ruby/multi_xml/files/multi_xml-0.6.0-ox24.patch [new file with mode: 0644]
dev-ruby/multi_xml/multi_xml-0.6.0-r1.ebuild [new file with mode: 0644]

diff --git a/dev-ruby/multi_xml/files/multi_xml-0.6.0-ox24.patch b/dev-ruby/multi_xml/files/multi_xml-0.6.0-ox24.patch
new file mode 100644 (file)
index 0000000..a0568a8
--- /dev/null
@@ -0,0 +1,23 @@
+From f9d18d87c3340aa53f524524bf189b99459ab1e6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
+Date: Thu, 18 May 2017 23:10:48 +0200
+Subject: [PATCH] Update for ox > 2.4.11
+
+There is more pedantic parsing of white-space characters in ox > 2.4.11. Better to set explicitly the expected skip mode.
+---
+ lib/multi_xml/parsers/ox.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/multi_xml/parsers/ox.rb b/lib/multi_xml/parsers/ox.rb
+index e52a560..dc1413e 100644
+--- a/lib/multi_xml/parsers/ox.rb
++++ b/lib/multi_xml/parsers/ox.rb
+@@ -29,7 +29,7 @@ def parse_error
+       def parse(io)
+         handler = Handler.new
+-        ::Ox.sax_parse(handler, io, :convert_special => true)
++        ::Ox.sax_parse(handler, io, convert_special: true, skip: :skip_return)
+         handler.doc
+       end
diff --git a/dev-ruby/multi_xml/multi_xml-0.6.0-r1.ebuild b/dev-ruby/multi_xml/multi_xml-0.6.0-r1.ebuild
new file mode 100644 (file)
index 0000000..e995f1a
--- /dev/null
@@ -0,0 +1,39 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+USE_RUBY="ruby23 ruby24 ruby25"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+RUBY_FAKEGEM_TASK_DOC="yard"
+
+RUBY_FAKEGEM_DOCDIR="doc"
+RUBY_FAKEGEM_EXTRADOC="README.md"
+
+RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A generic swappable back-end for XML parsing"
+HOMEPAGE="https://www.rubydoc.info/gems/multi_xml"
+SRC_URI="https://github.com/sferik/multi_xml/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="MIT"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+SLOT="0"
+IUSE=""
+
+ruby_add_bdepend "doc? ( dev-ruby/yard )"
+ruby_add_bdepend "test? ( dev-ruby/ox )"
+
+all_ruby_prepare() {
+       eapply "${FILESDIR}/${P}-ox24.patch"
+
+       sed -i -e '/simplecov/,/^end/ s:^:#:' spec/helper.rb || die
+       sed -i -e '/bundler/I s:^:#:' -e '/yardstick/,/end/ s:^:#:' Rakefile || die
+}
+
+each_ruby_test() {
+       CI=true each_fakegem_test
+}