*/*: Bump copyright on files touched this year
[gentoo.git] / dev-ruby / multi_json / multi_json-1.13.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 USE_RUBY="ruby23 ruby24 ruby25 ruby26"
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="~alpha amd64 arm ~arm64 hppa ia64 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                 spec/multi_json_spec.rb
46
47         # Avoid simplecov which only works with ruby 1.9
48         sed -i -e '/simplecov/d' -e '/SimpleCov.formatter/,/SimpleCov.start/ d' spec/spec_helper.rb || die
49
50         # Remove unpackaged and for our purposes unneeded coveralls
51         sed -i -e '/coveralls/d' spec/spec_helper.rb || die
52
53         # Avoid testing unpackaged adapters
54         rm spec/{gson,jr_jackson,oj}_adapter_spec.rb || die
55 }
56
57 each_ruby_test() {
58         for t in spec/*_spec.rb; do
59                 ${RUBY} -S rspec-3 ${t} || die
60         done
61 }