Subject: [bug#50537] [PATCH v2 05/27] gnu: Add ruby-braintree.

From: Stephen Paul Weber <[email-masked]>
Date: Wed, 27 Apr 2022 13:46:11 -0500

* gnu/pacakges/ruby.scm (ruby-braintree): New variable.
---
 gnu/packages/ruby.scm | 46 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 34d5a22908..f9edb4ac3f 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -12345,3 +12345,49 @@ completes")
       "XMPP DSL for Ruby written on top of EventMachine and Nokogiri")
     (home-page "https://github.com/adhearsion/blather")
     (license license:expat)))
+
+(define-public ruby-braintree
+  (package
+    (name "ruby-braintree")
+    (version "4.4.0")
+    (source
+     (origin
+       (method git-fetch)
+       ;; Download from GitHub because the rubygems version does not contain
+       ;; Rakefile.
+       (uri (git-reference
+             (url "https://github.com/braintree/braintree_ruby")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0dzf26yhmlf65464nranvqg5rzhrc8gfaqbg3p4ld3abz8ccnw08"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:test-target "test:unit"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'less-strict-dependencies
+           (lambda _
+             (substitute* "Gemfile"
+               (("gem \"libxml-ruby\", \"3.2.0\"") "gem \"libxml-ruby\", \"~> 3.0.0\"")
+               (("gem \"rspec\", \"3.9.0\"") "gem \"rspec\", \"~> 3.8.0\"")
+               (("gem \"rubocop\", \"~>1.12.0\"") "gem \"rubocop\", \"~> 1.10.0\""))
+             #t)))))
+    (propagated-inputs
+      `(("ruby-builder" ,ruby-builder)
+        ("ruby-rexml" ,ruby-rexml)))
+    (native-inputs
+     `(("ruby-rspec" ,ruby-rspec)
+       ("ruby-libxml" ,ruby-libxml)
+       ("ruby-pry" ,ruby-pry)
+       ("ruby-rake" ,ruby-rake)
+       ("ruby-webrick" ,ruby-webrick)
+       ("ruby-rubocop" ,ruby-rubocop)))
+    (synopsis
+      "Resources and tools integrating Braintree's global payments platform")
+    (description
+      "Resources and tools for developers to integrate Braintree's global
+payments platform.")
+    (home-page "https://www.braintreepayments.com/")
+    (license license:expat)))
-- 
2.30.2