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

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

[nongnu] elpa/inf-ruby 4f6a265640 178/265: Add support for zeus console


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 4f6a265640 178/265: Add support for zeus console
Date: Sat, 9 Jul 2022 21:59:24 -0400 (EDT)

branch: elpa/inf-ruby
commit 4f6a2656402f02088b8a645fc71792ab580c624f
Author: Philipp Fehre <philipp@fehre.co.uk>
Commit: Philipp Fehre <philipp@fehre.co.uk>

    Add support for zeus console
    
    When a `.zeus.sock` file is present in the current directory this means
    that the project uses [zeus](https://github.com/burke/zeus) and would be
    suited to use it to launch a console. Depending on if zeus is installed
    globally or for the current project only this might require `bundle
    exec` to run.
---
 inf-ruby.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index 340c96d6d2..39399290ec 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -630,7 +630,8 @@ keymaps to bind `inf-ruby-switch-from-compilation' to `ะก-x 
C-q'."
        'inf-ruby-switch-from-compilation)))
 
 (defvar inf-ruby-console-patterns-alist
-  '((inf-ruby-console-rails-p . rails)
+  '((".zeus.sock" . zeus)
+    (inf-ruby-console-rails-p . rails)
     ("*.gemspec" . gem)
     (inf-ruby-console-racksh-p . racksh)
     ("Gemfile" . default))
@@ -657,7 +658,7 @@ This checks if the current line is a pry or ruby-debug 
prompt.")
 ;;;###autoload
 (defun inf-ruby-console-auto ()
   "Run the appropriate Ruby console command.
-The command and and the directory to run it from are detected
+The command and the directory to run it from are detected
 automatically."
   (interactive)
   (let* ((dir (locate-dominating-file default-directory
@@ -674,6 +675,13 @@ automatically."
        (inf-ruby-file-contents-match "config/application.rb"
                                      "\\_<Rails::Application\\_>")))
 
+;;;###autoload
+(defun inf-ruby-console-zeus (dir)
+  (interactive "D")
+  (let ((default-directory (file-name-as-directory dir))
+        (exec-prefix (if (executable-find "zeus") "" "bundle exec ")))
+    (run-ruby (concat exec-prefix "zeus console") "zeus")))
+
 ;;;###autoload
 (defun inf-ruby-console-rails (dir)
   "Run Rails console in DIR."



reply via email to

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