Date: Friday, January 31, 2020 @ 19:48:39 Author: shibumi Revision: 560842
add ruby-json-schema for puppet Added: ruby-json-schema/ ruby-json-schema/repos/ ruby-json-schema/trunk/ ruby-json-schema/trunk/PKGBUILD ruby-json-schema/trunk/fix-broken-ruby26-and-newer-tests.patch -----------------------------------------+ PKGBUILD | 58 ++++++++++++++++++++++++++++++ fix-broken-ruby26-and-newer-tests.patch | 15 +++++++ 2 files changed, 73 insertions(+) Added: ruby-json-schema/trunk/PKGBUILD =================================================================== --- ruby-json-schema/trunk/PKGBUILD (rev 0) +++ ruby-json-schema/trunk/PKGBUILD 2020-01-31 19:48:39 UTC (rev 560842) @@ -0,0 +1,58 @@ +# Maintainer: Christian Rebischke <[email protected]> +# Contributor: Roberto Valentini <valantin89 [at] gmail [dot] com> +# Contributor: Tim Meusel <[email protected]> + +_gemname='json-schema' +pkgname="ruby-${_gemname}" +pkgver=2.8.1 +pkgrel=2 +pkgdesc='Interface for validating JSON objects against a JSON schema conforming to JSON Schema Draft 4.' +arch=('any') +url='https://github.com/ruby-json-schema/json-schema' +license=('MIT') +makedepends=('ruby-rdoc' 'ruby-bundler') +checkdepends=('ruby-rake' 'ruby-minitest' 'ruby-test-unit' 'ruby-webmock') +depends=('ruby' 'ruby-addressable') +options=(!emptydirs) +source=("${url}/archive/v${pkgver}/${pkgname}-v${pkgver}.tar.gz" + 'fix-broken-ruby26-and-newer-tests.patch') +sha512sums=('4634fb46e0cf7cbe74def73bcdd1f8bbdf50430477cd5a2bba47c79a17f63b582d68c9064b5aec70c17b0e73db5032ddffb0a036d2f6e34ff571880b325f297b' + 'cf11d279877860cb7508ef7ed47ae48e48b240bf828abedb049570481f42e6e777f9e9cd29b329b762d8ce29bb150cfb017f7f2175da753f191241f95a3dfaae') + +prepare() { + cd "${srcdir}/${_gemname}-${pkgver}" + + # remove simplecov. It's listed as a dependency, but not actually used/required + sed --in-place '/simplecov/d' Gemfile + + # replace upper version boundaries for ruby gems + sed --in-place 's|~>|>=|g' "${_gemname}.gemspec" + + # the output of the ipaddr lib changed. + # This patch adjusts the expected output to match ruby2.6 and newer + # this is based on https://github.com/ruby-json-schema/json-schema/pull/437 + patch --forward --verbose --strip=1 --input=../fix-broken-ruby26-and-newer-tests.patch +} + +build() { + cd "${srcdir}/${_gemname}-${pkgver}" + gem build "${_gemname}.gemspec" +} + +check() { + cd "${srcdir}/${_gemname}-${pkgver}" + rake test +} + +package() { + cd "${srcdir}/${_gemname}-${pkgver}" + local _gemdir="$(gem env gemdir)" + gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem" + + install -Dm 644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}/" + install -Dm 644 CHANGELOG.md CONTRIBUTING.md CONTRIBUTORS.md README.md -t "${pkgdir}/usr/share/doc/${pkgname}" + + rm -rf "${pkgdir}/${_gemdir}/cache" +} + +# vim: ts=2 sw=2 et: Added: ruby-json-schema/trunk/fix-broken-ruby26-and-newer-tests.patch =================================================================== --- ruby-json-schema/trunk/fix-broken-ruby26-and-newer-tests.patch (rev 0) +++ ruby-json-schema/trunk/fix-broken-ruby26-and-newer-tests.patch 2020-01-31 19:48:39 UTC (rev 560842) @@ -0,0 +1,15 @@ +diff --git a/lib/json-schema/attributes/formats/ip.rb b/lib/json-schema/attributes/formats/ip.rb +index 04b2e3a..172132d 100644 +--- a/lib/json-schema/attributes/formats/ip.rb ++++ b/lib/json-schema/attributes/formats/ip.rb +@@ -10,8 +10,8 @@ module JSON + + begin + ip = IPAddr.new(data) +- rescue ArgumentError => e +- raise e unless e.message == 'invalid address' ++ rescue => e ++ raise e unless e.message.start_with?("invalid address") + end + + family = ip_version == 6 ? Socket::AF_INET6 : Socket::AF_INET
