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/rspec-core/files/, dev-ruby/rspec-core/
Date: Sat, 05 Jan 2019 07:58:41
Message-Id: 1546675103.00158abc8c79cd227980de4d6434d51f15abd1f9.graaff@gentoo
1 commit: 00158abc8c79cd227980de4d6434d51f15abd1f9
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 5 07:54:03 2019 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 5 07:58:23 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00158abc
7
8 dev-ruby/rspec-core: add ruby26
9
10 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 .../rspec-core/files/rspec-core-3.8.0-ruby26.patch | 23 ++++++
14 dev-ruby/rspec-core/rspec-core-3.8.0-r1.ebuild | 94 ++++++++++++++++++++++
15 2 files changed, 117 insertions(+)
16
17 diff --git a/dev-ruby/rspec-core/files/rspec-core-3.8.0-ruby26.patch b/dev-ruby/rspec-core/files/rspec-core-3.8.0-ruby26.patch
18 new file mode 100644
19 index 00000000000..7c4bc9f7e50
20 --- /dev/null
21 +++ b/dev-ruby/rspec-core/files/rspec-core-3.8.0-ruby26.patch
22 @@ -0,0 +1,23 @@
23 +From 5e6171ee7dadd520991153009eb01d7be3c82e7e Mon Sep 17 00:00:00 2001
24 +From: "Keiji, Yoshimi" <walf443@×××××.com>
25 +Date: Mon, 10 Dec 2018 22:40:16 +0900
26 +Subject: [PATCH] Fixed warnings: lib/rspec/core/metadata.rb:172: warning:
27 + Object#=~ is deprecated; it always returns nil (#2582)
28 +
29 +---
30 + lib/rspec/core/metadata.rb | 2 +-
31 + 1 file changed, 1 insertion(+), 1 deletion(-)
32 +
33 +diff --git a/lib/rspec/core/metadata.rb b/lib/rspec/core/metadata.rb
34 +index 094a7a3b3..c68627ac5 100644
35 +--- a/lib/rspec/core/metadata.rb
36 ++++ b/lib/rspec/core/metadata.rb
37 +@@ -169,7 +169,7 @@ def file_path_and_line_number_from(backtrace)
38 + end
39 +
40 + def description_separator(parent_part, child_part)
41 +- if parent_part.is_a?(Module) && child_part =~ /^(#|::|\.)/
42 ++ if parent_part.is_a?(Module) && /^(?:#|::|\.)/.match(child_part.to_s)
43 + ''.freeze
44 + else
45 + ' '.freeze
46
47 diff --git a/dev-ruby/rspec-core/rspec-core-3.8.0-r1.ebuild b/dev-ruby/rspec-core/rspec-core-3.8.0-r1.ebuild
48 new file mode 100644
49 index 00000000000..37a30a9087f
50 --- /dev/null
51 +++ b/dev-ruby/rspec-core/rspec-core-3.8.0-r1.ebuild
52 @@ -0,0 +1,94 @@
53 +# Copyright 1999-2019 Gentoo Authors
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=6
57 +USE_RUBY="ruby23 ruby24 ruby25 ruby26"
58 +
59 +RUBY_FAKEGEM_TASK_TEST="none"
60 +RUBY_FAKEGEM_RECIPE_DOC="rdoc"
61 +
62 +RUBY_FAKEGEM_EXTRADOC="Changelog.md README.md"
63 +
64 +# Also install this custom path since internal paths depend on it.
65 +RUBY_FAKEGEM_EXTRAINSTALL="exe"
66 +
67 +RUBY_FAKEGEM_GEMSPEC="rspec-core.gemspec"
68 +
69 +inherit ruby-fakegem eapi7-ver
70 +
71 +DESCRIPTION="A Behaviour Driven Development (BDD) framework for Ruby"
72 +HOMEPAGE="https://github.com/rspec/rspec-core"
73 +SRC_URI="https://github.com/rspec/${PN}/archive/v${PV}.tar.gz -> ${P}-git.tgz"
74 +
75 +LICENSE="MIT"
76 +SLOT="3"
77 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
78 +IUSE="highlight"
79 +
80 +SUBVERSION="$(ver_cut 1-2)"
81 +
82 +ruby_add_rdepend "
83 + =dev-ruby/rspec-support-${SUBVERSION}*
84 + !!<dev-ruby/rspec-core-2.14.8-r4
85 + highlight? ( >=dev-ruby/coderay-1.1.1 )
86 +"
87 +
88 +ruby_add_bdepend "test? (
89 + >=dev-ruby/nokogiri-1.5.2
90 + >=dev-ruby/coderay-1.1.1
91 + dev-ruby/syntax
92 + >=dev-ruby/thread_order-1.1.0
93 + >=dev-ruby/rspec-expectations-3.8.0:3
94 + >=dev-ruby/rspec-mocks-2.99.0:3
95 + )"
96 +
97 +PATCHES=( "${FILESDIR}/${P}-ruby26.patch" )
98 +
99 +all_ruby_prepare() {
100 + # Don't set up bundler: it doesn't understand our setup.
101 + sed -i -e '/[Bb]undler/d' Rakefile || die
102 +
103 + # Avoid dependency on cucumber since we can't run the features anyway.
104 + sed -i -e '/[Cc]ucumber/ s:^:#:' Rakefile || die
105 +
106 + # Duplicate exe also in bin. We can't change it since internal stuff
107 + # also depends on this and fixing that is going to be fragile. This
108 + # way we can at least install proper bin scripts.
109 + cp -R exe bin || die
110 +
111 + # Avoid unneeded dependency on git.
112 + sed -i -e 's/git ls-files --/find/' rspec-core.gemspec || die
113 +
114 + # Avoid aruba dependency so that we don't end up in dependency hell.
115 + sed -i -e '/ArubaLoader/,/^end/ s:^:#:' -e '/Aruba/ s:^:#:' spec/spec_helper.rb || die
116 + rm -f spec/support/aruba_support.rb || die
117 + rm -f spec/integration/{bisect_runners,failed_line_detection,filtering,order,persistence_failures,suite_hooks_errors}_spec.rb || die
118 + rm -f spec/integration/{spec_file_load_errors,output_stream,fail_if_no_examples}_spec.rb || die
119 +
120 + # Avoid a spec failing due to path issues
121 + sed -i -e '/does not load files in the default path when run by ruby/,/end/ s:^:#:' \
122 + spec/rspec/core/configuration_spec.rb || die
123 +
124 + # Avoid a spec that depends on dev-ruby/rspec to lessen circular
125 + # dependencies, bug 662328
126 + sed -i -e '/loads mocks and expectations when the constants are referenced/askip "gentoo: bug 662328"' spec/rspec/core_spec.rb || die
127 +
128 + # Avoid a spec depending on specifics on local networks
129 + # This fails when localhost resolves to ::1 which may be a
130 + # ruby regression in the drb/acl code.
131 + rm -f spec/rspec/core/bisect/server_spec.rb || die
132 +}
133 +
134 +each_ruby_prepare() {
135 + sed -i -e 's:ruby -e:'${RUBY}' -e:' spec/rspec/core_spec.rb || die
136 +}
137 +
138 +each_ruby_test() {
139 + PATH="${S}/bin:${PATH}" RUBYLIB="${S}/lib" ${RUBY} -Ilib bin/rspec spec || die "Tests failed."
140 +}
141 +
142 +all_ruby_install() {
143 + all_fakegem_install
144 +
145 + ruby_fakegem_binwrapper rspec /usr/bin/rspec-3 'gem "rspec", "~>3.0"'
146 +}