emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/inf-ruby f3c927c1b9 230/265: inf-ruby--irb-needs-nomultili


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby f3c927c1b9 230/265: inf-ruby--irb-needs-nomultiline-p: Handle irb or ruby absence
Date: Sat, 9 Jul 2022 21:59:28 -0400 (EDT)

branch: elpa/inf-ruby
commit f3c927c1b917a20ce6b2228d480db43171aadd9b
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    inf-ruby--irb-needs-nomultiline-p: Handle irb or ruby absence
---
 inf-ruby.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 288cc1efd4..8634ffb56a 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -108,9 +108,11 @@ returns a string."
     command))
 
 (defun inf-ruby--irb-needs-nomultiline-p ()
-  (let ((version (nth 1 (split-string
-                         (shell-command-to-string "irb -v") "[ (]"))))
-    (version<= "1.2.0" version)))
+  (let* ((output (shell-command-to-string "irb -v"))
+         (fields (split-string output "[ (]")))
+    (if (equal (car fields) "irb")
+        (version<= "1.2.0" (nth 1 fields))
+      (error "Irb version unknown: %s" output))))
 
 (defcustom inf-ruby-console-environment 'ask
   "Envronment to use for the `inf-ruby-console-*' commands.



reply via email to

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