# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=ruby-rspec-its
_gemname=${pkgname#ruby-}
pkgver=1.3.0
pkgrel=0
pkgdesc="RSpec extension gem for attribute matching"
url="https://rubygems.org/gems/rspec-its"
arch="noarch"
license="MIT"
checkdepends="ruby-rake ruby-rspec ruby-bunder"
depends="ruby ruby-rspec-core ruby-rspec-expectations"
source="$pkgname-$pkgver.tar.gz::https://github.com/rspec/rspec-its/archive/refs/tags/v$pkgver.tar.gz
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"
options="!check" # Depends on ruby-cucumber, which is not packaged yet.

build() {
	gem build $_gemname.gemspec
}

check() {
	rake
}

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

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

	# Clean-up...
	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc
}
sha512sums="
97be9ba1f46db44a3d60676056d5ad66ee84585ff133ffaf25c42fc1e899c33d9841a9440336a8bd52c58685d8b2b5505c5cef7bfb5d634bcbc370c4b1a8a287  ruby-rspec-its-1.3.0.tar.gz
660a01ba493dabe34ab1cb6a230cb06d98e1cd1c630fe650d25da2063e736a7fd3fa3ef2a905c23e65de6484c7b4e0eb49cdf12ce7e09c2740fb252c4cba670a  gemspec.patch
"
