[bug#34514,11/34] gnu: Add ruby-warden-oauth2.

Message ID 20190217192314.5666-11-mail@cbaines.net
State Accepted
Commit e42eecdb78130d9910d5569d8f7d220ad45f1bb8
Headers show
Series Add more Ruby gems, some Rails related | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied

Commit Message

Christopher Baines Feb. 17, 2019, 7:22 p.m. UTC
* gnu/packages/ruby.scm (ruby-warden-oauth2): New variable.
---
 gnu/packages/ruby.scm | 48 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

Comments

Ricardo Wurmus Feb. 20, 2019, 8:36 p.m. UTC | #1
Christopher Baines <mail@cbaines.net> writes:

> * gnu/packages/ruby.scm (ruby-warden-oauth2): New variable.

LGTM!

Patch

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index a67da64ce5..7a883c2366 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -5762,6 +5762,54 @@  support to both Ruby and JRuby.  It uses @code{unf_ext} on CRuby and
     (home-page "https://github.com/wardencommunity/warden")
     (license license:expat)))
 
+(define-public ruby-warden-oauth2
+  (package
+    (name "ruby-warden-oauth2")
+    (version "0.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "warden-oauth2" version))
+       (sha256
+        (base32
+         "1z9154lvzrnnfjbjkmirh4n811nygp6pm2fa6ikr7y1ysa4zv3cz"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:test-target "spec"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'remove-unnecessary-dependencies
+           (lambda _
+             (substitute* "Gemfile"
+               ;; All of these gems relate to development, and are unnecessary
+               ;; when running the tests
+               (("gem 'guard-bundler'") "")
+               (("gem 'guard'") "")
+               (("gem 'guard-rspec'") "")
+               (("gem 'rb-fsevent'") "")
+               (("gem 'pry'") "")
+               (("gem 'growl'") ""))
+             #t))
+         ;; The test suite doesn't work with rspec@2, and this is incompatible
+         ;; with the current version of Rake, so invoke Rspec directly
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "bundle" "exec" "rspec"))
+             #t)))))
+    (propagated-inputs
+     `(("ruby-warden" ,ruby-warden)))
+    (native-inputs
+     `(("bundler" ,bundler)
+       ("ruby-rspec" ,ruby-rspec-2)
+       ("ruby-rack-test" ,ruby-rack-test)))
+    (synopsis "OAuth 2.0 strategies for Warden")
+    (description
+     "This library extends Warden to support OAuth 2.0 authorized API
+requests.")
+    (home-page "https://github.com/opperator/warden-oauth2")
+    (license license:expat)))
+
 (define-public ruby-webmock-2
   (package
     (name "ruby-webmock")