[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby 1b89400e6f 227/265: Add '--nomultiline' with newe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby 1b89400e6f 227/265: Add '--nomultiline' with newer IRB versions |
Date: |
Sat, 9 Jul 2022 21:59:28 -0400 (EDT) |
branch: elpa/inf-ruby
commit 1b89400e6ff91fbdf6267d24dcef2804a19d1829
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Add '--nomultiline' with newer IRB versions
Fixes #127, fixes #128, fixes #130.
---
inf-ruby.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index abb2fa4360..f93164ff10 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -83,13 +83,15 @@ Also see the description of `ielm-prompt-read-only'."
:group 'inf-ruby)
(defcustom inf-ruby-implementations
- '(("ruby" . "irb --prompt default --noreadline -r irb/completion")
+ '(("ruby" . inf-ruby--irb-command)
("jruby" . "jruby -S irb --prompt default --noreadline -r
irb/completion")
("rubinius" . "rbx -r irb/completion")
("yarv" . "irb1.9 -r irb/completion")
("macruby" . "macirb -r irb/completion")
("pry" . "pry"))
- "An alist of ruby implementations to irb executable names."
+ "An alist mapping Ruby implementations to Irb commands.
+CDR of each entry must be either a string or a function that
+returns a string."
:type '(repeat (cons string string))
:group 'inf-ruby)
@@ -99,6 +101,13 @@ Also see the description of `ielm-prompt-read-only'."
inf-ruby-implementations))
: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)
+ (setq command (concat command " --nomultiline")))
+ command))
+
(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
@@ -338,6 +347,8 @@ to that buffer. Otherwise create a new buffer."
(setq impl (or impl "ruby"))
(let ((command (cdr (assoc impl inf-ruby-implementations))))
+ (when (functionp command)
+ (setq command (funcall command)))
(run-ruby command impl)))
;;;###autoload
- [nongnu] elpa/inf-ruby 9c4d799faf 183/265: inf-ruby-console-zeus: Add docstring, (continued)
- [nongnu] elpa/inf-ruby 9c4d799faf 183/265: inf-ruby-console-zeus: Add docstring, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 700c453610 181/265: Merge pull request #91 from asok/multi, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 54eb6bf6d6 185/265: Bump the version, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 57710da5c8 214/265: inf-ruby-console-gem: Use '--prompt default --noreadline', ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c2bb2f7186 215/265: Add ruby-send-{buffer, line}-and-go commands, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 6bfa7c9411 217/265: Add `ansi-color-process-output` to comint output functions, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby d2cc45ac1a 221/265: Bump the version, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4a7ed23971 222/265: Revert "Add `ansi-color-process-output` to comint output functions", ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 928b1dd2c2 223/265: Merge pull request #123 from nonsequitur/revert-118-master, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby b228a7d9af 225/265: inf-ruby-error-regexp-alist: bol-anchor for better performance, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 1b89400e6f 227/265: Add '--nomultiline' with newer IRB versions,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby 41e5ed3a88 229/265: run-ruby: Update for the latest change, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 6291121307 236/265: It is a triangle, right?, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 2ec94b4b33 237/265: Exclude --noreadline when Irb version is > 1.2.0, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby bb7d4ca086 240/265: Merge pull request #141 from sharmanr/send-definition, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 1fc972ecda 243/265: Merge pull request #142 from PuercoPop/patch-1, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c6990a60c7 244/265: Implement inf-ruby-reuse-older-buffers, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby f484fa82cc 247/265: ruby-send-last-stmt: New command, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 6943bf1e78 254/265: Apply code review - print evaluation as default, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 3940b91ac5 252/265: Create load current ruby file fn and key binding, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c49b3d360a 253/265: Apply code review - remove unecessary line, ELPA Syncer, 2022/07/09