# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-multi_json
_gemname=${pkgname#ruby-}
pkgver=1.13.0
pkgrel=0
pkgdesc="A gem to provide easy switching between different JSON backends"
url="https://rubygems.org/gems/multi_json"
arch="noarch"
license="MIT"
depends="ruby"
source="$pkgname-$pkgver.tar.gz::https://github.com/intridea/$_gemname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"
	sed -i '/spec.signing_key/d' $_gemname.gemspec
}

build() {
	cd "$builddir"
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	cd "$builddir"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm "$geminstdir"/*.md
}

sha512sums="b168b2a093865f48f1a4d1941e8cfead8b3efba73bcd59660dae581a77ab7149f0f452f1280e69061187f35c84b6eeff70144f815f9f669db03dba49100143aa  ruby-multi_json-1.13.0.tar.gz"
