[bug#34222,11/15] gnu: Add ruby-cliver.

Message ID 20190127170820.28937-11-mail@cbaines.net
State Accepted
Headers show
Series Add ruby-rubocop and dependencies. | expand

Checks

Context Check Description
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed
cbaines/applying patch fail Apply failed

Commit Message

Christopher Baines Jan. 27, 2019, 5:08 p.m. UTC
Requirement of ruby-parser.

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

Comments

Ricardo Wurmus Jan. 27, 2019, 5:38 p.m. UTC | #1
Christopher Baines <mail@cbaines.net> writes:

> Requirement of ruby-parser.
>
> * gnu/packages/ruby.scm (ruby-cliver): New variable.
[…]

> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         ;; Avoid this issue with rspec@2
> +         ;; NoMethodError: undefined method `last_comment'
> +         (replace 'check
> +           (lambda* (#:key tests? #:allow-other-keys)
> +             (when tests?
> +               (invoke "rspec"))
> +             #t)))))
> +    (native-inputs
> +     `(("bundler" ,bundler)
> +       ("ruby-rspec" ,ruby-rspec-2)))

Is this a problem that would disappear when using a later version of
Rspec?

--
Ricardo
Christopher Baines Jan. 27, 2019, 6:48 p.m. UTC | #2
Ricardo Wurmus <rekado@elephly.net> writes:

> Christopher Baines <mail@cbaines.net> writes:
>
>> Requirement of ruby-parser.
>>
>> * gnu/packages/ruby.scm (ruby-cliver): New variable.
> […]
>
>> +    (arguments
>> +     '(#:phases
>> +       (modify-phases %standard-phases
>> +         ;; Avoid this issue with rspec@2
>> +         ;; NoMethodError: undefined method `last_comment'
>> +         (replace 'check
>> +           (lambda* (#:key tests? #:allow-other-keys)
>> +             (when tests?
>> +               (invoke "rspec"))
>> +             #t)))))
>> +    (native-inputs
>> +     `(("bundler" ,bundler)
>> +       ("ruby-rspec" ,ruby-rspec-2)))
>
> Is this a problem that would disappear when using a later version of
> Rspec?

I don't think so, I get a different exception which looks to me like an
incompatibility between the tests and rspec@3 in Guix. This
`last_comment' related error is a issue between Rspec 2 and more recent
versions of Rake, and I've updated the comment as below to try and
explain this.

+    (Build-system ruby-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; Avoid a incompatibility between rspec@2 and rake. Using rspec@3
+         ;; would be nice, but the tests look to be incompatible:
+         ;;
+         ;; NoMethodError: undefined method `last_comment'
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "rspec"))
+             #t)))))

Patch

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 2bb9ea1cff..061659e59f 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -869,6 +869,38 @@  code in Merb and Rails.")
     (home-page "https://github.com/jnunemaker/crack")
     (license license:expat)))
 
+(define-public ruby-cliver
+  (package
+    (name "ruby-cliver")
+    (version "0.3.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "cliver" version))
+       (sha256
+        (base32
+         "096f4rj7virwvqxhkavy0v55rax10r4jqf8cymbvn4n631948xc7"))))
+    (build-system ruby-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; Avoid this issue with rspec@2
+         ;; NoMethodError: undefined method `last_comment'
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "rspec"))
+             #t)))))
+    (native-inputs
+     `(("bundler" ,bundler)
+       ("ruby-rspec" ,ruby-rspec-2)))
+    (synopsis "Assertions for command-line dependencies in Ruby")
+    (description
+     "@code{cliver} provides a way to detect missing command-line
+dependencies, including versions.")
+    (home-page "https://github.com/yaauie/cliver")
+    (license license:expat)))
+
 (define-public ruby-czmq-ffi-gen
   (package
     (name "ruby-czmq-ffi-gen")