summaryrefslogtreecommitdiff
path: root/dev-ruby/multi_json
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ruby/multi_json')
-rw-r--r--dev-ruby/multi_json/Manifest1
-rw-r--r--dev-ruby/multi_json/multi_json-1.15.0-r1.ebuild75
2 files changed, 76 insertions, 0 deletions
diff --git a/dev-ruby/multi_json/Manifest b/dev-ruby/multi_json/Manifest
index 7cc56b4737ce..34451c9c42c3 100644
--- a/dev-ruby/multi_json/Manifest
+++ b/dev-ruby/multi_json/Manifest
@@ -1,3 +1,4 @@
DIST multi_json-1.15.0.tar.gz 24932 BLAKE2B c99c5c6b152c91dedc38fd24f8697f918064c603bfd72c55213f3ac8afd14d3c0ba31b7c3fb91c9998fcc8a5386f41a6983c53b40119558b99194ba58c06cc91 SHA512 55c873e45cdc59e75823aa031eb6d792cb9dc744b13a682fc279a8375b925db7a984256d61aa5454795a59722794a774a0ed5b6bf518db253152f4af67f46dea
+EBUILD multi_json-1.15.0-r1.ebuild 2692 BLAKE2B 04cab4361bd3b564c5eca4afafc82b314704f8eb4452994a5a7abf8c3a3538073d0916f4e155c2ed9caf512c37b4fd0c2563092394643ae6ce001dad90803050 SHA512 e1a34b79f0608cb78fd76bdc61f383a0ef5414144fbc64c3e8591281aeba40285cd4a3ebe0d20f066b30ffc3178278b8b2103c3a3a7b79d6bf481a06e9397a1f
EBUILD multi_json-1.15.0.ebuild 2453 BLAKE2B 5399cad0afcf2ee8df8254f2d1a2b19d1edb769157a4cc3bf6dc0f09eb3243294e95c6ff3279f7b374b80ea25467df6ce3084f5e96c61bc230096b5629f9d143 SHA512 d1407321494a91f8567227b102ee705f1c9ad5d4739944a1316fcca3de49dfaa69efc01ce006d818c218dac5764bbde71307dcddb3fc5ed05dc99da6e17ec67f
MISC metadata.xml 346 BLAKE2B 5ac783be1157fb3847a6fd648f66d421de79a35d5bdbd155455c9791093af408a6b0fca4d4435b95d83d3fb773c835673fa284bba94d29612c5af0c8148172bc SHA512 aa03ee50a365f31b48b294cc667208944ace3f89965feab02ef9e75a90d621086635ce732adc1e2beaf96cfb67c7084fc7bba1c45df139583a6ab705adc7c170
diff --git a/dev-ruby/multi_json/multi_json-1.15.0-r1.ebuild b/dev-ruby/multi_json/multi_json-1.15.0-r1.ebuild
new file mode 100644
index 000000000000..fa3188b909fe
--- /dev/null
+++ b/dev-ruby/multi_json/multi_json-1.15.0-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby31 ruby32 ruby33"
+
+RUBY_FAKEGEM_RECIPE_TEST="rspec3"
+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/intridea/multi_json"
+SRC_URI="https://github.com/intridea/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 ~amd64-linux ~x86-linux ~ppc-macos ~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/rspec:3 dev-ruby/yard )"
+
+ruby_add_bdepend "test? ( dev-ruby/json
+ dev-ruby/yajl-ruby )"
+
+all_ruby_prepare() {
+ sed -i -e '/[Bb]undler/d' Rakefile spec/spec_helper.rb || die "Unable to remove bundler."
+
+ # Remove unimportant rspec options not supported by rspec 2.6.
+ rm .rspec || die
+
+ # Remove specs specific to oj since we don't package oj yet.
+ sed -i -e '/defaults to the best available gem/,/^ end/ s:^:#:' \
+ -e '/Oj does not create symbols on parse/,/^ end/ s:^:#:' \
+ -e '/with Oj.default_settings/,/^ end/ s:^:#:' \
+ -e '/using one-shot parser/,/^ end/ s:^:#:' \
+ -e '/jrjackson/askip "unpackaged"' \
+ spec/multi_json_spec.rb
+
+ # Avoid simplecov which only works with ruby 1.9
+ sed -i -e '/simplecov/d' -e '/SimpleCov.formatter/,/SimpleCov.start/ d' spec/spec_helper.rb || die
+
+ # Remove unpackaged and for our purposes unneeded coveralls
+ sed -i -e '/coveralls/d' spec/spec_helper.rb || die
+
+ # Avoid testing unpackaged adapters
+ rm spec/{gson,nsjsonserialization,jr_jackson,oj}_adapter_spec.rb || die
+
+ # Fix expectations confused by ruby30 kwargs
+ sed -e "/expect/ s/:foo => 'bar', :fizz => 'buzz'/{:foo => 'bar', :fizz => 'buzz'}/" \
+ -e "/expect/ s/:bar => :baz/{:bar => :baz}/" \
+ -i spec/shared/adapter.rb || die
+ sed -e '/expect/ s/:indent => "\\t"/{:indent => "\t"}/' \
+ -e '/expect/ s/:quirks_mode => false, :create_additions => false/{:quirks_mode => false, :create_additions => false}/' \
+ -i spec/shared/json_common_adapter.rb || die
+ sed -e "/expect/ s/:foo => 'bar'/{:foo => 'bar'}/" -i spec/multi_json_spec.rb || die
+
+ # Avoid spec failing due to an issue in dev-ruby/json,
+ # https://github.com/intridea/multi_json/commit/70cc6e4a64152e5fc29c4a1109209cef25a6c073
+ sed -e '/dumps time in correct format/ s/it/xit/' -i spec/shared/adapter.rb || die
+}
+
+each_ruby_test() {
+ for t in spec/*_spec.rb; do
+ ${RUBY} -S rspec-3 ${t} || die
+ done
+}