Fixes for guix and ruby 2.7

Stephen Paul Weber created

Change summary

guix.scm            | 206 ++++++++++++++++++++++++++++++----------------
lib/customer_fwd.rb |   3 
test/test_web.rb    |  23 ++---
web.rb              |   3 
4 files changed, 147 insertions(+), 88 deletions(-)

Detailed changes

guix.scm 🔗

@@ -13,6 +13,76 @@
   (ice-9 rdelim)
   (ice-9 popen))
 
+(define-public ruby-bigdecimal
+  (package
+    (name "ruby-bigdecimal")
+    (version "4.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "bigdecimal" version))
+       (sha256
+        (base32 "19y406nx17arzsbc515mjmr6k5p59afprspa1k423yd9cp8d61wb"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:tests? #f))
+    (synopsis
+     "This library provides arbitrary-precision decimal floating-point number class.")
+    (description
+     "This library provides arbitrary-precision decimal floating-point number class.")
+    (home-page "https://github.com/ruby/bigdecimal")
+    (license #f)))
+
+(define-public ruby-ox
+  (package
+    (name "ruby-ox")
+    (version "2.14.23")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "ox" version))
+       (sha256
+        (base32 "0rhv8qdnm3s34yvsvmrii15f2238rk3psa6pq6x5x367sssfv6ja"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:tests? #f))
+    (propagated-inputs (list ruby-bigdecimal))
+    (synopsis
+     "A fast XML parser and object serializer that uses only standard C lib.
+
+Optimized XML (Ox), as the name implies was written to provide speed optimized
+XML handling. It was designed to be an alternative to Nokogiri and other Ruby
+XML parsers for generic XML parsing and as an alternative to Marshal for Object
+serialization. ")
+    (description
+     "This package provides a fast XML parser and object serializer that uses only
+standard C lib.  Optimized XML (Ox), as the name implies was written to provide
+speed optimized XML handling.  It was designed to be an alternative to Nokogiri
+and other Ruby XML parsers for generic XML parsing and as an alternative to
+Marshal for Object serialization.")
+    (home-page "http://www.ohler.com/ox/")
+    (license license:expat)))
+
+(define-public ruby-base64
+  (package
+    (name "ruby-base64")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "base64" version))
+       (sha256
+        (base32 "0yx9yn47a8lkfcjmigk79fykxvr80r4m1i35q82sxzynpbm7lcr7"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:tests? #f))
+    (synopsis
+     "Support for encoding and decoding binary data using a Base64 representation.")
+    (description
+     "Support for encoding and decoding binary data using a Base64 representation.")
+    (home-page "https://github.com/ruby/base64")
+    (license #f)))
+
 (define-public ruby-addressable
   (package
     (name "ruby-addressable")
@@ -678,39 +748,47 @@ requests.")
       "https://github.com/lostisland/faraday_middleware")
     (license license:expat)))
 
+(define-public ruby-faraday-follow-redirects
+  (package
+    (name "ruby-faraday-follow-redirects")
+    (version "0.5.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "faraday-follow_redirects" version))
+       (sha256
+        (base32 "1b8hgpci3wjm3rm41bzpasvsc5j253ljyg5rsajl62dkjk497pjw"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:tests? #f))
+    (propagated-inputs (list ruby-faraday))
+    (synopsis
+     "Faraday 1.x and 2.x compatible extraction of FaradayMiddleware::FollowRedirects.
+")
+    (description "Faraday 1.x and 2.x compatible extraction of
+@code{FaradayMiddleware::FollowRedirects}.")
+    (home-page "https://github.com/tisba/faraday-follow-redirects")
+    (license license:expat)))
+
 (define-public ruby-bandwidth-iris
   (package
     (name "ruby-bandwidth-iris")
-    (version "v7.0.0")
+    (version "7.4.0")
     (source
-      (origin
-      (method git-fetch)
-      (uri (git-reference
-          (url "https://github.com/Bandwidth/ruby-bandwidth-iris")
-          (commit version)))
-        (sha256
-          (base32
-            "0w6plk7n807fw9w29c4za7hf0g01m06ldm553lg3fl6c10kydj7q"))))
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "ruby-bandwidth-iris" version))
+       (sha256
+        (base32 "1vixiw22jc57imsv5va0vb4h1ylqr3kf90az1q9k049wgf6ipqkn"))))
     (build-system ruby-build-system)
     (arguments
      ; Tests don't require helper for some reason, so all fail...
      '(#:tests? #f))
-    (propagated-inputs
-      `(("ruby-activesupport" ,ruby-activesupport)
-        ("ruby-builder" ,ruby-builder)
-        ("ruby-faraday" ,ruby-faraday)
-        ("ruby-faraday-middleware"
-         ,ruby-faraday-middleware)
-        ("ruby-nori" ,ruby-nori)))
-    (native-inputs
-     `(("ruby-rspec" ,ruby-rspec)
-       ("ruby-yard" ,ruby-yard)))
-    (synopsis
-      "Gem for integrating to Bandwidth's Iris API")
-    (description
-      "Gem for integrating to Bandwidth's Iris API")
-    (home-page
-      "https://github.com/bandwidthcom/ruby-bandwidth-iris")
+    (propagated-inputs (list ruby-activesupport ruby-builder ruby-faraday
+                             ruby-faraday-follow-redirects ruby-rexml))
+    (synopsis "Gem for integrating to Bandwidth's Iris API")
+    (description "Gem for integrating to Bandwidth's Iris API.")
+    (home-page "https://github.com/bandwidthcom/ruby-bandwidth-iris")
     (license license:expat)))
 
 (define-public ruby-sentry-core
@@ -1105,24 +1183,23 @@ formatting, and more.")
 (define-public ruby-bandwidth-sdk
   (package
     (name "ruby-bandwidth-sdk")
-    (version "6.1.0")
+    (version "17.3.0")
     (source
      (origin
        (method url-fetch)
        (uri (rubygems-uri "bandwidth-sdk" version))
        (sha256
-        (base32 "050dfpwx5hf02cja3kr1j4mqrqdl9cwwghbng0q82gg6dnh572ww"))))
+        (base32 "0i2fihf2wg975nicqw4r0iji48qkfdnhjd6b5v56422slhxd7zz1"))))
     (build-system ruby-build-system)
     (arguments
      `(#:tests? #f))
-    (propagated-inputs (list ruby-builder
-                             ruby-certifi
-                             ruby-faraday
-                             ruby-faraday-http-cache
-                             ruby-faraday-middleware
-                             ruby-logging))
-    (synopsis "Bandwidth's set of APIs")
-    (description "Bandwidth's set of APIs")
+    (propagated-inputs (list ruby-faraday ruby-faraday-multipart ruby-marcel
+                             ruby-ox))
+    (synopsis
+     "The official client SDK for Bandwidth's Voice, Messaging, MFA, and WebRTC APIs")
+    (description
+     "The official client SDK for Bandwidth's Voice, Messaging, MFA, and
+@code{WebRTC} APIs.")
     (home-page "https://github.com/Bandwidth/ruby-sdk")
     (license license:expat)))
 
@@ -1214,17 +1291,17 @@ country objects.  It includes data from ISO 3166")
 (define-public ruby-faraday-em-http
   (package
     (name "ruby-faraday-em-http")
-    (version "52104d59129fed5056a0aa8395a7c67506fc5b88")
+    (version "14a06dc1431429ff5e6291bc6f671db0c3a636a5")
     (source
       (origin
       (method git-fetch)
       (uri (git-reference
-          (url "https://github.com/singpolyma/faraday-em_http")
+          (url "https://github.com/Amolith/faraday-em_http")
           (commit version)))
       (file-name (git-file-name name version))
         (sha256
           (base32
-            "1gs3hs0mpzl9b4z490zhsak4mwxc9mvhzq76kih16pvmzyjjwl27"))))
+            "16nnsvyr7n2rw84zcw5n5aidhs4k6rrdhzf6002wqfj85mymxp7s"))))
     (build-system ruby-build-system)
     (arguments
      `(#:tests? #f))
@@ -1294,18 +1371,19 @@ country objects.  It includes data from ISO 3166")
 (define-public ruby-faraday-net-http
   (package
     (name "ruby-faraday-net-http")
-    (version "1.0.1")
+    (version "3.0.0")
     (source
      (origin
        (method url-fetch)
        (uri (rubygems-uri "faraday-net_http" version))
        (sha256
-        (base32 "1fi8sda5hc54v1w3mqfl5yz09nhx35kglyx72w7b8xxvdr0cwi9j"))))
+        (base32 "0yicplzlh5da8pr64286zga3my86cjsb2y9dqlzsacpw8hbkmjvw"))))
     (build-system ruby-build-system)
     (arguments
      `(#:tests? #f))
+    ;(propagated-inputs (list ruby-net-http))
     (synopsis "Faraday adapter for Net::HTTP")
-    (description "Faraday adapter for Net::HTTP")
+    (description "Faraday adapter for Net::HTTP.")
     (home-page "https://github.com/lostisland/faraday-net_http")
     (license license:expat)))
 
@@ -1328,25 +1406,6 @@ country objects.  It includes data from ISO 3166")
     (home-page "https://github.com/lostisland/faraday-net_http_persistent")
     (license license:expat)))
 
-(define-public ruby-faraday-httpclient
-  (package
-    (name "ruby-faraday-httpclient")
-    (version "1.0.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (rubygems-uri "faraday-httpclient" version))
-       (sha256
-        (base32 "0fyk0jd3ks7fdn8nv3spnwjpzx2lmxmg2gh4inz3by1zjzqg33sc"))))
-    (build-system ruby-build-system)
-    (arguments
-     `(#:tests? #f))
-    (propagated-inputs (list ruby-httpclient))
-    (synopsis "Faraday adapter for HTTPClient")
-    (description "Faraday adapter for HTTPClient")
-    (home-page "https://github.com/lostisland/faraday-httpclient")
-    (license license:expat)))
-
 (define-public ruby-excon
   (package
     (name "ruby-excon")
@@ -1387,13 +1446,17 @@ country objects.  It includes data from ISO 3166")
 (define-public ruby-faraday-em-synchrony
   (package
     (name "ruby-faraday-em-synchrony")
-    (version "1.0.0")
+    (version "b45e3d62e9fa4e5765806754c167be4b9b8f1168")
     (source
-     (origin
-       (method url-fetch)
-       (uri (rubygems-uri "faraday-em_synchrony" version))
-       (sha256
-        (base32 "1vgrbhkp83sngv6k4mii9f2s9v5lmp693hylfxp2ssfc60fas3a6"))))
+      (origin
+      (method git-fetch)
+      (uri (git-reference
+          (url "https://github.com/Amolith/faraday-em_synchrony")
+          (commit version)))
+      (file-name (git-file-name name version))
+        (sha256
+          (base32
+            "1lczay8fmg26wrkny48cn8w4nsp92frinag17sa40chfdm8ylzwn"))))
     (build-system ruby-build-system)
     (arguments
      `(#:tests? #f))
@@ -1405,26 +1468,25 @@ country objects.  It includes data from ISO 3166")
 (define-public ruby-faraday
   (package
     (name "ruby-faraday")
-    (version "1.10.1")
+    (version "2.8.0")
     (source
      (origin
        (method url-fetch)
        (uri (rubygems-uri "faraday" version))
        (sha256
-        (base32 "037w5kg3y9jrwgg7izfn1pmzngy0hdhcr7slmxwqa3mdb4rx9r9q"))))
+        (base32 "0nndw6c9rn7bqkzq44ay48qyhbsvg32wd0isy4gxpva1s7v17wy8"))))
     (build-system ruby-build-system)
     (arguments
      `(#:tests? #f))
     (propagated-inputs (list ruby-faraday-em-http
                              ruby-faraday-em-synchrony
+                             ruby-faraday-net-http
                              ruby-faraday-excon
-                             ruby-faraday-httpclient
                              ruby-faraday-multipart
-                             ruby-faraday-net-http
-                             ruby-faraday-net-http-persistent
                              ruby-faraday-patron
                              ruby-faraday-rack
                              ruby-faraday-retry
+                             ruby-base64
                              ruby-ruby2-keywords))
     (synopsis "HTTP/REST API client library.")
     (description "HTTP/REST API client library.")
@@ -1651,7 +1713,6 @@ I/O)")
 		  ruby-em-promise.rb
 		  ruby-em-synchrony
 		  ruby-eventmachine
-		  ruby-faraday-em-http
 		  ruby-link-header-parser
 		  ruby-money-open-exchange-rates
 		  ruby-multibases
@@ -1664,6 +1725,7 @@ I/O)")
 		  ruby-slim
 		  ruby-statsd-instrument
 		  ruby-thin
+		  ruby-multi-json
 		  ruby-value-semantics))
     (native-inputs
       '(list

lib/customer_fwd.rb 🔗

@@ -112,7 +112,8 @@ class CustomerFwd
 		yield request if block_given?
 		BANDWIDTH_VOICE.create_call(
 			account,
-			Bandwidth::CreateCall.new(request.to_h)
+			Bandwidth::CreateCall.new(request.to_h),
+			{}
 		).call_id
 	end
 

test/test_web.rb 🔗

@@ -774,20 +774,15 @@ class WebTest < Minitest::Test
 	em :test_inbound_limit_digits_leg2
 
 	def test_inbound_limit_hangup
-		Web::BANDWIDTH_VOICE.expect(
-			:update_call,
-			nil,
-			[
-				"test_bw_account",
-				"bcall",
-				Matching.new do |arg|
-					assert_equal(
-						"http://example.org/inbound/calls/oocall/voicemail",
-						arg.redirect_url
-					)
-				end
-			]
-		)
+		Web::BANDWIDTH_VOICE.expect(:update_call, nil) do |acc, cid, body, **kw|
+			assert_equal "test_bw_account", acc
+			assert_equal "bcall", cid
+			assert_equal(
+				"http://example.org/inbound/calls/oocall/voicemail",
+				body.redirect_url
+			)
+			assert_equal({}, kw)
+		end
 
 		post(
 			"/inbound/calls/bcall/transfer_complete",

web.rb 🔗

@@ -186,7 +186,8 @@ class Web < Roda
 		BANDWIDTH_VOICE.update_call(
 			CONFIG[:creds][:account],
 			call_id,
-			body
+			body,
+			{}
 		)
 	rescue Bandwidth::ApiError
 		# If call does not exist, don't need to hang up or send to voicemail