www-client/google-chrome-beta: automated update (84.0.4147.30)
[gentoo.git] / dev-ruby / fast_gettext / fast_gettext-2.0.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 USE_RUBY="ruby24 ruby25 ruby26 ruby27"
7
8 RUBY_FAKEGEM_TASK_DOC=""
9 RUBY_FAKEGEM_EXTRADOC="CHANGELOG Readme.md"
10
11 RUBY_FAKEGEM_RECIPE_TEST="rspec3"
12
13 RUBY_FAKEGEM_GEMSPEC="fast_gettext.gemspec"
14
15 inherit ruby-fakegem
16
17 DESCRIPTION="GetText but 3.5x faster, 560x less memory, clean namespace and threadsave!"
18 HOMEPAGE="https://github.com/grosser/fast_gettext"
19 SRC_URI="https://github.com/grosser/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
20
21 LICENSE="public-domain"
22 SLOT="2"
23 KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
24 IUSE=""
25
26 ruby_add_bdepend "test? ( dev-ruby/bundler )"
27
28 all_ruby_prepare() {
29         rm Gemfile.lock || die
30
31         # Remove jeweler and bump from Gemfile since they are not needed for tests.
32         sed -i -e '/jeweler/d' -e '/bump/d' -e '/appraisal/d' Gemfile || die
33         sed -i -e '/single/I s:^:#:' spec/spec_helper.rb || die
34         sed -i -e '/SingleCov/ s:^:#:' spec/{*,*/*}/*spec.rb || die
35
36         # Avoid unneeded dependency on git and development dependencies.
37         sed -e '/git ls-files/ s:^:#:' \
38                 -e '/\(wwtd\|bump\|sqlite3\|activerecord\|i18n\|single_cov\|forking_test_runner\|rubocop\)/ s:^:#:' \
39                 -e 's:require_relative ":require "./:' \
40                 -i fast_gettext.gemspec || die
41
42         # Avoid a test dependency on activerecord since this is now in the
43         # dependency tree for app-admin/puppet and many arches don't have
44         # rails keyworded.
45         sed -i -e '/active_record/ s:^:#:' spec/spec_helper.rb || die
46         rm -f spec/fast_gettext/translation_repository/db_spec.rb || die
47         rm -f spec/fast_gettext/storage_spec.rb || die
48         sed -i -e '/with i18n loaded/,/^  end/ s:^:#:' spec/fast_gettext/vendor/string_spec.rb || die
49
50         # Don't run a test that requires safe mode which we can't provide
51         # due to insecure directory settings for the portage dir. This spec
52         # also calls out to ruby which won't work with different ruby
53         # implementations.
54         sed -i -e '/can work in SAFE mode/,/^  end/ s:^:#:' spec/fast_gettext/translation_repository/mo_spec.rb || die
55 }
56
57 each_ruby_prepare() {
58         # Make sure the right ruby interpreter is used
59         sed -i -e "s:bundle exec ruby:bundle exec ${RUBY}:" spec/fast_gettext/vendor/*spec.rb || die
60 }