guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/20: gnu: Add ruby-single-cov.


From: guix-commits
Subject: 04/20: gnu: Add ruby-single-cov.
Date: Wed, 20 May 2020 17:53:30 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit def7908a59bbf27f5d660ebf79fe1cc7a0153133
Author: Marius Bakke <address@hidden>
AuthorDate: Wed May 20 12:38:59 2020 +0200

    gnu: Add ruby-single-cov.
    
    * gnu/packages/ruby.scm (ruby-single-cov): New public variable.
---
 gnu/packages/ruby.scm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 4570a54..b3e2826 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -4077,6 +4077,61 @@ invocation, and source and documentation browsing.")
     (home-page "https://pryrepl.org";)
     (license license:expat)))
 
+(define-public ruby-single-cov
+  (package
+    (name "ruby-single-cov")
+    (version "1.3.2")
+    (home-page "https://github.com/grosser/single_cov";)
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference (url home-page)
+                                  (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "05qdzpcai1p23a120gb9bxkfl4y73k9hicx34ch2lsk31lgi9bl7"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:test-target "default"
+       #:phases (modify-phases %standard-phases
+                  (replace 'replace-git-ls-files
+                    (lambda _
+                      (substitute* "single_cov.gemspec"
+                        (("`git ls-files lib/ bin/ MIT-LICENSE`")
+                         "`find lib/ bin/ MIT-LICENSE -type f | sort`"))
+                      #t))
+                  (add-before 'check 'remove-version-constraints
+                    (lambda _
+                      (delete-file "Gemfile.lock")
+                      #t))
+                  (add-before 'check 'make-files-writable
+                    (lambda _
+                      ;; Tests need to create local directories and open files
+                      ;; with write permissions.
+                      (for-each make-file-writable
+                                (find-files "specs" #:directories? #t))
+                      #t))
+                  (add-before 'check 'disable-failing-test
+                    (lambda _
+                      ;; XXX: This test copies assets from minitest, but can
+                      ;; not cope with the files being read-only.  Just skip
+                      ;; it for now.
+                      (substitute* "specs/single_cov_spec.rb"
+                        (("it \"complains when coverage is bad\"")
+                         "xit \"complains when coverage is bad\""))
+                      #t)))))
+    (native-inputs
+     `(("ruby-bump" ,ruby-bump)
+       ("ruby-minitest" ,ruby-minitest)
+       ("ruby-rspec" ,ruby-rspec)
+       ("ruby-simplecov" ,ruby-simplecov)))
+    (synopsis "Code coverage reporting tool")
+    (description
+     "This package provides actionable code coverage reports for Ruby
+projects.  It has very little overhead and can be easily integrated with
+development tools to catch coverage problems early.")
+    (license license:expat)))
+
 (define-public ruby-guard
   (package
     (name "ruby-guard")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]