summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-11-25 17:11:14 +0100
committerRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-12-14 14:06:29 +0100
commitd56ff88b6c63bb4f3e7877986b313ed944d6f341 (patch)
treee0542124f8767376aaddfa876090c108f7f0771d
parentac09beba841cb6b3323c80d28fcbae8aa2d9b87a (diff)
downloadguix-d56ff88b6c63bb4f3e7877986b313ed944d6f341.tar.gz
gnu: Add ruby-sanitize.
* gnu/packages/ruby.scm (ruby-sanitize): New variable.
-rw-r--r--gnu/packages/ruby.scm32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index cb813403a0..846e358554 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2367,6 +2367,38 @@ access the result as a Nokogiri parsed document.")
     (home-page "https://github.com/rubys/nokogumbo/")
     (license license:asl2.0)))
 
+(define-public ruby-sanitize
+  (package
+    (name "ruby-sanitize")
+    (version "4.0.0")
+    (source (origin
+              (method url-fetch)
+              ;; The gem does not include the Rakefile, so we download the
+              ;; release tarball from Github.
+              (uri (string-append "https://github.com/rgrove/"
+                                  "sanitize/archive/v" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "055xnj38l60gxnnng76kpy2l2jbrp0byjdyq17jw79w7l4b40znr"))))
+    (build-system ruby-build-system)
+    (propagated-inputs
+     `(("ruby-crass" ,ruby-crass)
+       ("ruby-nokogiri" ,ruby-nokogiri)
+       ("ruby-nokogumbo" ,ruby-nokogumbo)))
+    (native-inputs
+     `(("bundler" ,bundler)
+       ("ruby-minitest" ,ruby-minitest)
+       ("ruby-redcarpet" ,ruby-redcarpet)
+       ("ruby-yard" ,ruby-yard)))
+    (synopsis "Whitelist-based HTML and CSS sanitizer")
+    (description
+     "Sanitize is a whitelist-based HTML and CSS sanitizer.  Given a list of
+acceptable elements, attributes, and CSS properties, Sanitize will remove all
+unacceptable HTML and/or CSS from a string.")
+    (home-page "https://github.com/rgrove/sanitize/")
+    (license license:expat)))
+
 (define-public ruby-ox
   (package
     (name "ruby-ox")