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

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

[nongnu] elpa/inf-ruby e4ae089218 228/265: inf-ruby-console-gem: Support


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby e4ae089218 228/265: inf-ruby-console-gem: Support new IRB
Date: Sat, 9 Jul 2022 21:59:28 -0400 (EDT)

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

    inf-ruby-console-gem: Support new IRB
    
    Fixes #128
---
 inf-ruby.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index f93164ff10..8a21039c89 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -102,12 +102,16 @@ returns a string."
   :group 'inf-ruby)
 
 (defun inf-ruby--irb-command ()
-  (let ((command "irb --prompt default --noreadline -r irb/completion")
-        (version (nth 1 (split-string (shell-command-to-string "irb -v") "[ 
(]"))))
-    (when (version<= "1.2.0" version)
+  (let ((command "irb --prompt default --noreadline -r irb/completion"))
+    (when (inf-ruby--irb-needs-nomultiline-p)
       (setq command (concat command " --nomultiline")))
     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)))
+
 (defcustom inf-ruby-console-environment 'ask
   "Envronment to use for the `inf-ruby-console-*' commands.
 If the value is not a string, ask the user to choose from the
@@ -929,6 +933,8 @@ Gemfile, it should use the `gemspec' instruction."
                  (concat " -r " (file-name-sans-extension file)))
                files
                ""))))
+    (when (inf-ruby--irb-needs-nomultiline-p)
+      (setq base-command (concat base-command " --nomultiline")))
     (inf-ruby-console-run
      (concat base-command args
              " --prompt default --noreadline -r irb/completion")



reply via email to

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