Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/i18n/files/, dev-ruby/i18n/
Date: Fri, 25 Dec 2015 08:46:58
Message-Id: 1451033210.89ca3a93218db57eaa570c6b942169403730c746.graaff@gentoo
1 commit: 89ca3a93218db57eaa570c6b942169403730c746
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 25 08:46:26 2015 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 25 08:46:50 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89ca3a93
7
8 dev-ruby/i18n: add ruby22
9
10 Add an unapplied upstream pull request to make sure ruby22
11 tests work and to avoid similar issues with frozen classes
12 when using it.
13
14 Package-Manager: portage-2.2.24
15
16 .../i18n/files/i18n-0.7.0-frozen-classes.patch | 31 ++++++++++++
17 dev-ruby/i18n/i18n-0.7.0-r1.ebuild | 56 ++++++++++++++++++++++
18 2 files changed, 87 insertions(+)
19
20 diff --git a/dev-ruby/i18n/files/i18n-0.7.0-frozen-classes.patch b/dev-ruby/i18n/files/i18n-0.7.0-frozen-classes.patch
21 new file mode 100644
22 index 0000000..ff60194
23 --- /dev/null
24 +++ b/dev-ruby/i18n/files/i18n-0.7.0-frozen-classes.patch
25 @@ -0,0 +1,31 @@
26 +From bbbdedc0c78ec941a84d161d5c610a358310cf99 Mon Sep 17 00:00:00 2001
27 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@××××××.com>
28 +Date: Tue, 20 Jan 2015 14:34:44 +0100
29 +Subject: [PATCH] Ignore metadata for frozen classes.
30 +
31 +---
32 + lib/i18n/backend/metadata.rb | 8 ++++++--
33 + 1 file changed, 6 insertions(+), 2 deletions(-)
34 +
35 +diff --git a/lib/i18n/backend/metadata.rb b/lib/i18n/backend/metadata.rb
36 +index 52c0a29..a8d922a 100644
37 +--- a/lib/i18n/backend/metadata.rb
38 ++++ b/lib/i18n/backend/metadata.rb
39 +@@ -21,11 +21,15 @@ class << self
40 + def included(base)
41 + Object.class_eval do
42 + def translation_metadata
43 +- @translation_metadata ||= {}
44 ++ unless self.frozen?
45 ++ @translation_metadata ||= {}
46 ++ else
47 ++ {}
48 ++ end
49 + end
50 +
51 + def translation_metadata=(translation_metadata)
52 +- @translation_metadata = translation_metadata
53 ++ @translation_metadata = translation_metadata unless self.frozen?
54 + end
55 + end unless Object.method_defined?(:translation_metadata)
56 + end
57
58 diff --git a/dev-ruby/i18n/i18n-0.7.0-r1.ebuild b/dev-ruby/i18n/i18n-0.7.0-r1.ebuild
59 new file mode 100644
60 index 0000000..a25c199
61 --- /dev/null
62 +++ b/dev-ruby/i18n/i18n-0.7.0-r1.ebuild
63 @@ -0,0 +1,56 @@
64 +# Copyright 1999-2014 Gentoo Foundation
65 +# Distributed under the terms of the GNU General Public License v2
66 +# $Id$
67 +
68 +EAPI=5
69 +
70 +USE_RUBY="ruby20 ruby21 ruby22"
71 +
72 +RUBY_FAKEGEM_RECIPE_TEST="test"
73 +RUBY_FAKEGEM_RECIPE_DOC="rdoc"
74 +RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
75 +
76 +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
77 +
78 +inherit ruby-fakegem versionator
79 +
80 +DESCRIPTION="Add Internationalization support to your Ruby application"
81 +HOMEPAGE="http://rails-i18n.org/"
82 +SRC_URI="https://github.com/svenfuchs/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
83 +
84 +LICENSE="MIT"
85 +SLOT="$(get_version_component_range 1-2)"
86 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
87 +IUSE=""
88 +
89 +RUBY_PATCHES=( ${P}-frozen-classes.patch )
90 +
91 +ruby_add_bdepend "test? (
92 + >=dev-ruby/activesupport-3.2 <dev-ruby/activesupport-4.3
93 + dev-ruby/bundler
94 + dev-ruby/mocha:0.13
95 + dev-ruby/test_declarative )"
96 +
97 +all_ruby_prepare() {
98 + # Remove bundler lock files since we cannot depend on specific
99 + # versions in Gentoo.
100 + rm gemfiles/*.lock || die
101 +}
102 +
103 +each_ruby_test() {
104 + case ${RUBY} in
105 + *ruby22)
106 + versions="4.2"
107 + ;;
108 + *)
109 + versions="3.2 4.0 4.1 4.2"
110 + ;;
111 + esac
112 +
113 + for version in ${versions} ; do
114 + if has_version "dev-ruby/activesupport:${version}" ; then
115 + einfo "Running tests with activesupport ${version}"
116 + BUNDLE_GEMFILE="${S}/gemfiles/Gemfile.rails-${version}.x" ${RUBY} -S bundle exec ${RUBY} -S rake test || die
117 + fi
118 + done
119 +}