www-client/google-chrome-beta: automated update (84.0.4147.30)
[gentoo.git] / dev-ruby / multi_json / multi_json-1.14.1.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_RECIPE_TEST="rspec3"
9 RUBY_FAKEGEM_TASK_DOC="yard"
10
11 RUBY_FAKEGEM_DOCDIR="rdoc"
12 RUBY_FAKEGEM_EXTRADOC="README.md"
13
14 RUBY_FAKEGEM_GEMSPEC="multi_json.gemspec"
15
16 inherit ruby-fakegem
17
18 SRC_URI="https://github.com/intridea/multi_json/archive/v${PV}.tar.gz -> ${P}.tar.gz"
19 DESCRIPTION="A gem to provide swappable JSON backends"
20 HOMEPAGE="https://github.com/intridea/multi_json"
21 LICENSE="MIT"
22
23 KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
24 SLOT="0"
25 IUSE=""
26
27 ruby_add_rdepend "|| ( >=dev-ruby/json-1.4:* >=dev-ruby/yajl-ruby-1.0 )"
28
29 ruby_add_bdepend "doc? ( dev-ruby/rspec:3 dev-ruby/yard )"
30
31 ruby_add_bdepend "test? ( dev-ruby/json
32         dev-ruby/yajl-ruby )"
33
34 all_ruby_prepare() {
35         sed -i -e '/[Bb]undler/d' Rakefile spec/spec_helper.rb || die "Unable to remove bundler."
36
37         # Remove unimportant rspec options not supported by rspec 2.6.
38         rm .rspec || die
39
40         # Remove specs specific to oj since we don't package oj yet.
41         sed -i -e '/defaults to the best available gem/,/^  end/ s:^:#:' \
42                 -e '/Oj does not create symbols on parse/,/^    end/ s:^:#:' \
43                 -e '/with Oj.default_settings/,/^    end/ s:^:#:' \
44                 -e '/using one-shot parser/,/^  end/ s:^:#:' \
45                 -e '/jrjackson/askip "unpackaged"' \
46                 spec/multi_json_spec.rb
47
48         # Avoid simplecov which only works with ruby 1.9
49         sed -i -e '/simplecov/d' -e '/SimpleCov.formatter/,/SimpleCov.start/ d' spec/spec_helper.rb || die
50
51         # Remove unpackaged and for our purposes unneeded coveralls
52         sed -i -e '/coveralls/d' spec/spec_helper.rb || die
53
54         # Avoid testing unpackaged adapters
55         rm spec/{gson,nsjsonserialization,jr_jackson,oj}_adapter_spec.rb || die
56 }
57
58 each_ruby_test() {
59         for t in spec/*_spec.rb; do
60                 ${RUBY} -S rspec-3 ${t} || die
61         done
62 }