1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 USE_RUBY="ruby23 ruby24 ruby25 ruby26"
8 RUBY_FAKEGEM_RECIPE_TEST="rspec3"
9 RUBY_FAKEGEM_TASK_DOC="yard"
11 RUBY_FAKEGEM_DOCDIR="rdoc"
12 RUBY_FAKEGEM_EXTRADOC="README.md"
14 RUBY_FAKEGEM_GEMSPEC="multi_json.gemspec"
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"
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"
27 ruby_add_rdepend "|| ( >=dev-ruby/json-1.4:* >=dev-ruby/yajl-ruby-1.0 )"
29 ruby_add_bdepend "doc? ( dev-ruby/rspec:3 dev-ruby/yard )"
31 ruby_add_bdepend "test? ( dev-ruby/json
35 sed -i -e '/[Bb]undler/d' Rakefile spec/spec_helper.rb || die "Unable to remove bundler."
37 # Remove unimportant rspec options not supported by rspec 2.6.
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
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
50 # Remove unpackaged and for our purposes unneeded coveralls
51 sed -i -e '/coveralls/d' spec/spec_helper.rb || die
53 # Avoid testing unpackaged adapters
54 rm spec/{gson,jr_jackson,oj}_adapter_spec.rb || die
58 for t in spec/*_spec.rb; do
59 ${RUBY} -S rspec-3 ${t} || die