summary refs log tree commit diff
path: root/gnu/packages/ruby.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-06-27 12:37:42 +0100
committerChristopher Baines <mail@cbaines.net>2023-07-10 08:25:58 +0100
commitde33bed5c4fc0c951030ed502e1985996f7561c6 (patch)
treea1ecc4bbb88c6fb0221be1ce9f923e3afb1b58a5 /gnu/packages/ruby.scm
parent4ba5e2929dfaa6e97875c8bc50a3b02709cc546c (diff)
downloadguix-de33bed5c4fc0c951030ed502e1985996f7561c6.tar.gz
gnu: Add ruby-http-accept.
* gnu/packages/ruby.scm (ruby-http-accept): New variable.
Diffstat (limited to 'gnu/packages/ruby.scm')
-rw-r--r--gnu/packages/ruby.scm38
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 8786e665b7..a775a97c46 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -11196,6 +11196,44 @@ defined in a @file{.env} file.")
 defined in a @file{.env} file.  This is the Rails variant, adapted for use
 with Ruby on Rails projects.")))
 
+(define-public ruby-http-accept
+  (package
+    (name "ruby-http-accept")
+    (version "2.2.0")
+    (source (origin
+              (method git-fetch)        ;for the tests
+              (uri (git-reference
+                    (url "https://github.com/socketry/http-accept")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1d69cy12hqbcqrhw4dibvdq5pqklxsa59kih6pzl479nxq79rgs7"))))
+    (build-system ruby-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'remove-missing-key-directive
+            ;; This seem to be a common problem in Ruby projects (see:
+            ;; https://github.com/prawnpdf/ttfunk/issues/99).
+            (lambda _
+              (substitute* "http-accept.gemspec"
+                ((".*spec.signing_key.*") ""))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "rspec")))))))
+    (native-inputs
+     (list ruby-rspec
+           ruby-covered))
+    (synopsis "Parse Accept and Accept-Language HTTP headers")
+    (description
+     "This package provides a set of parsers for Accept and Accept-Language
+HTTP headers.")
+    (home-page "https://github.com/socketry/http-accept")
+    (license license:expat)))
+
 (define-public ruby-http-cookie
   (package
     (name "ruby-http-cookie")