[arch-commits] Commit in ruby-json-schema/repos (3 files)

Christian Rebischke shibumi at archlinux.org
Fri Jan 31 19:50:12 UTC 2020


    Date: Friday, January 31, 2020 @ 19:50:12
  Author: shibumi
Revision: 560845

archrelease: copy trunk to community-any

Added:
  ruby-json-schema/repos/community-any/
  ruby-json-schema/repos/community-any/PKGBUILD
    (from rev 560844, ruby-json-schema/trunk/PKGBUILD)
  ruby-json-schema/repos/community-any/fix-broken-ruby26-and-newer-tests.patch
    (from rev 560844, 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(+)

Copied: ruby-json-schema/repos/community-any/PKGBUILD (from rev 560844, ruby-json-schema/trunk/PKGBUILD)
===================================================================
--- community-any/PKGBUILD	                        (rev 0)
+++ community-any/PKGBUILD	2020-01-31 19:50:12 UTC (rev 560845)
@@ -0,0 +1,58 @@
+# Maintainer: Christian Rebischke <chris.rebischke at archlinux.org>
+# Contributor: Roberto Valentini <valantin89 [at] gmail [dot] com>
+# Contributor: Tim Meusel <tim at bastelfreak.de>
+
+_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'
+            'cd2e2fc621edb7e49855eebeaddb098b0c3fbea817201e36b9f2d43df38306f790c2ebc2cc19092bc3084b8a3b1a69e2271f6497845f6defc410082a91971dcc')
+
+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:

Copied: ruby-json-schema/repos/community-any/fix-broken-ruby26-and-newer-tests.patch (from rev 560844, ruby-json-schema/trunk/fix-broken-ruby26-and-newer-tests.patch)
===================================================================
--- community-any/fix-broken-ruby26-and-newer-tests.patch	                        (rev 0)
+++ community-any/fix-broken-ruby26-and-newer-tests.patch	2020-01-31 19:50:12 UTC (rev 560845)
@@ -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



More information about the arch-commits mailing list