summaryrefslogtreecommitdiff
path: root/dev-ruby/multi_json/multi_json-1.19.0.ebuild
blob: 9f541bc557e120e57b0b0ecdc0f1394e3af277eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

USE_RUBY="ruby32 ruby33 ruby34"

RUBY_FAKEGEM_BINDIR=""
RUBY_FAKEGEM_TASK_DOC="yard"

RUBY_FAKEGEM_DOCDIR="rdoc"
RUBY_FAKEGEM_EXTRADOC="README.md"

RUBY_FAKEGEM_GEMSPEC="multi_json.gemspec"

inherit ruby-fakegem

DESCRIPTION="A gem to provide swappable JSON backends"
HOMEPAGE="https://github.com/sferik/multi_json"
SRC_URI="https://github.com/sferik/multi_json/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"

SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos ~x64-solaris"
IUSE="doc test"

ruby_add_rdepend "|| ( >=dev-ruby/json-1.4:* >=dev-ruby/yajl-ruby-1.0 )"

ruby_add_bdepend "doc? ( dev-ruby/yard )"

ruby_add_bdepend "test? ( dev-ruby/json
	dev-ruby/yajl-ruby )"

all_ruby_prepare() {
	# Bundler makes is impossible to deal only with packaged options.
	sed -e '/bundler/ s:^:#:' \
		-i test/test_helper.rb || die

	 # Avoid coverage dependencies
	sed -e '/mutant/ s:^:#:' \
		-e '/simplecov/,/^  end/ s:^:#:' \
		-i test/test_helper.rb || die
	sed -e '/cover/ s:^:#:' \
		-e '/Mutant/ s:^:#:' \
		-i test/multi_json/*.rb test/multi_json/*/*.rb test/multi_json/*/*/*.rb || die

	# Avoid integration tests requiring unpackaged providers
	rm -rf test/multi_json/integration || die

	# Avoid a test requiring ancient activesupport version.
	sed -e '/test_serializes_time_using_activesupport_format/askip "Too old"' \
		-e '/test_serializes_objects_that_define_to_hash/askip "Too old"' \
		-i test/multi_json/adapters/json_gem_test.rb || die
}

each_ruby_test() {
	CI=true ${RUBY} -Ilib:.:test -e "Dir['test/**/*.rb'].each{|f| require f}" || die
}