# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=ruby-yaml
_gemname=${pkgname#ruby-}
pkgver=0.3.0
pkgrel=0
pkgdesc="This module provides a Ruby interface for data serialization in YAML format."
url="https://rubygems.org/gems/yaml"
arch="noarch"
license="MIT"
checkdepends="ruby-rake ruby-bundler ruby-test-unit ruby-test-unit-ruby-core"
depends="ruby"
source="$pkgname-$pkgver.tar.gz::https://github.com/ruby/yaml/archive/refs/tags/v0.3.0.tar.gz
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"

prepare() {
	default_prepare

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

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

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

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

	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc
}

sha512sums="
5f61c35b23bdd6fdb9c7dd1115c3ed7d0002c1326369ccddaca6faa4cca1ad989cf0521030a4883e138c635b8f0efa273718d1c987b4f8b7e777cc3ee10d6fc8  ruby-yaml-0.3.0.tar.gz
b1020989ba6bfcfa8f0b9ef81934d7dcd4bae48a5ad09e99c7543db3fc2abc601fc626451cf10bdc1419acac63e9dc8aaae820fc537e27d5e8d2f3998949c922  gemspec.patch
"
