# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=ruby-erubi
pkgver=1.13.0
pkgrel=0
pkgdesc="small ERB implementation"
url="https://github.com/jeremyevans/erubi"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-minitest ruby-rake"
options="!check" # requires coveralls
source="$pkgname-$pkgver.tar.gz::https://github.com/jeremyevans/erubi/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/erubi-$pkgver"

build() {
	gem build erubi.gemspec
}

check() {
	rake spec
}

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

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		erubi

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

sha512sums="
abdce25b70045bb97d11f9426004a9af48f2d9a4126d5f4929dc7a66dd6fe7b58948b58867a066eaf24f656a6444d53bffcb497eb5d3f5a83dfbcb5c5f690200  ruby-erubi-1.13.0.tar.gz
"
