[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby 58568b6f7e 1/6: Add custom variable to specify a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby 58568b6f7e 1/6: Add custom variable to specify a wrapper for the determined commands to launch a console |
Date: |
Sun, 15 Dec 2024 22:01:49 -0500 (EST) |
branch: elpa/inf-ruby
commit 58568b6f7e20d5c6a0a54b5653ecd81bd0f5a572
Author: Hugo Sales <hugo@hsal.es>
Commit: Hugo Sales <hugo@hsal.es>
Add custom variable to specify a wrapper for the determined commands to
launch a console
This allows running the console inside a Docker container
---
inf-ruby.el | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 09adbda087..09533d3cb8 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -103,6 +103,12 @@ returns a string."
inf-ruby-implementations))
:group 'inf-ruby)
+(defcustom inf-ruby-wrapper-command ""
+ "Launcher command pattern to format the auto-detected command.
+Useful for running the shell in another host or a container (such as Docker).
Must include %s."
+ :type 'string
+ :group 'inf-ruby)
+
(defun inf-ruby--irb-command ()
(let ((command "irb --prompt default -r irb/completion --noreadline"))
(when (inf-ruby--irb-needs-nomultiline-p)
@@ -110,10 +116,11 @@ returns a string."
command))
(defun inf-ruby--irb-needs-nomultiline-p (&optional with-bundler)
- (let* ((output (car (last (apply #'process-lines
- (append
- (when with-bundler '("bundle" "exec"))
- '("irb" "-v"))))))
+ "Check if IRB needs the --nomultiline argument.
+WITH-BUNDLER, the command is wrapped with `bundle exec'."
+ (let* ((command (format (or inf-ruby-wrapper-command "%s")
+ (concat (when with-bundler "bundle exec ") "irb
-v")))
+ (output (car (last (apply #'process-lines (split-string-and-unquote
command)))))
(fields (split-string output "[ (]")))
(if (equal (car fields) "irb")
(version<= "1.2.0" (nth 1 fields))
@@ -1152,7 +1159,8 @@ contains the configuration for the known project types."
(capitalize (symbol-name type)))))
(defun inf-ruby-console-run (command name)
- (run-ruby-or-pop-to-buffer command name
+ "Ensure a buffer named NAME running the given COMMAND exists."
+ (run-ruby-or-pop-to-buffer (format inf-ruby-wrapper-command command) name
(inf-ruby-buffer-in-directory default-directory)))
;;;###autoload
- [nongnu] elpa/inf-ruby updated (6399a36682 -> d4cff9a323), ELPA Syncer, 2024/12/15
- [nongnu] elpa/inf-ruby f6f9e727f5 2/6: Update README do document 'inf-ruby-wrapper-command', ELPA Syncer, 2024/12/15
- [nongnu] elpa/inf-ruby 781d677941 4/6: Use call-process-shell-command instead of splitting right after concat, ELPA Syncer, 2024/12/15
- [nongnu] elpa/inf-ruby 22f816a369 5/6: README edits, ELPA Syncer, 2024/12/15
- [nongnu] elpa/inf-ruby d4cff9a323 6/6: Capitalize, ELPA Syncer, 2024/12/15
- [nongnu] elpa/inf-ruby 58568b6f7e 1/6: Add custom variable to specify a wrapper for the determined commands to launch a console,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby 7d216e5c8f 3/6: inf-ruby-wrapper-command: Set the default value to nil, ELPA Syncer, 2024/12/15