# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=ruby-ast-tdl
_gemname=${pkgname#ruby-}
pkgver=0.2.3
pkgrel=0
pkgdesc="Training Description Language for Artificial Sport Trainer"
url="https://github.com/firefly-cpp/ast-tdl"
arch="noarch"
license="MIT"
depends="ruby ruby-enum"
checkdepends="ruby-minitest"
source="$pkgname-$pkgver.tar.gz::https://github.com/firefly-cpp/$_gemname/archive/$pkgver/$_gemname-$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	ruby test/test_ast_tdl.rb
}

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

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

	# Remove unnecessary files.
	cd "$gemdir"
	rm -r cache/ build_info/ doc/
}

sha512sums="
f6c332128dae0692181b02fdd52d2ffe71c0e8f99fe2021b0be5eb5bd9bd2dd17e2ad5a42a17283b56d9302fafa3872e661b0f6c3731fc371f6dcd7e38cb9fd0  ruby-ast-tdl-0.2.3.tar.gz
"
