[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby 73e2142a99 194/265: Add new option inf-ruby-conso
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby 73e2142a99 194/265: Add new option inf-ruby-console-environment |
Date: |
Sat, 9 Jul 2022 21:59:25 -0400 (EDT) |
branch: elpa/inf-ruby
commit 73e2142a99e3161768bc746d478a860456ac8f44
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Add new option inf-ruby-console-environment
Closes #94.
---
inf-ruby.el | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index 2962b84398..d21450e2b6 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -99,6 +99,16 @@ Also see the description of `ielm-prompt-read-only'."
inf-ruby-implementations))
:group 'inf-ruby)
+(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
+available ones. Otherwise, just use the value.
+
+Currently only affects `inf-ruby-console-rails'."
+ :type '(choice
+ (const ask :tag "Ask the user")
+ (string :tag "Environment name")))
+
(defconst inf-ruby-prompt-format
(concat
(mapconcat
@@ -750,9 +760,7 @@ automatically."
"Run Rails console in DIR."
(interactive (list (inf-ruby-console-read-directory 'rails)))
(let* ((default-directory (file-name-as-directory dir))
- (envs (inf-ruby-console-rails-envs))
- (env (completing-read "Rails environment: " envs nil t
- nil nil (car (member "development" envs))))
+ (env (inf-ruby-console-rails-env))
(with-bundler (file-exists-p "Gemfile")))
(inf-ruby-console-run
(concat (when with-bundler "bundle exec ")
@@ -760,6 +768,15 @@ automatically."
env)
"rails")))
+(defun inf-ruby-console-rails-env ()
+ (if (stringp inf-ruby-console-environment)
+ inf-ruby-console-environment
+ (let ((envs (inf-ruby-console-rails-envs)))
+ (completing-read "Rails environment: "
+ envs
+ nil t
+ nil nil (car (member "development" envs))))))
+
(defun inf-ruby-console-rails-envs ()
(let ((files (file-expand-wildcards "config/environments/*.rb")))
(if (null files)
- [nongnu] elpa/inf-ruby 96408b9cad 149/265: Update MELPA URL, (continued)
- [nongnu] elpa/inf-ruby 96408b9cad 149/265: Update MELPA URL, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c353603f1f 140/265: Merge pull request #68 from Trevoke/patch-1, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 0885009c11 012/265: Version 2.2, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 37bae51429 015/265: Replace pointless setfs with setqs., ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 80a1c2c3d2 031/265: Fix commit 'Store non-whitespace input in the REPL history, ...', ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 0b27477d11 166/265: Tweak auto-enter and auto-exit to work better (or at all), ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby db89398caa 173/265: Recognize byebug prompt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby beb39ad5af 148/265: Define and use ruby-print-result, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 5c73e1a79c 143/265: Use INSIDE_EMACS, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 57b3419be3 175/265: Allow single quoted gemspec name, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 73e2142a99 194/265: Add new option inf-ruby-console-environment,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby 7aa37e9154 199/265: Add ruby-send-line function, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 05984b3d24 201/265: inf-ruby-console-read-directory: Fix for predicates with wildcards, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 401f191d53 045/265: Touch up docstrings, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby d308394e7a 041/265: inf-ruby-output-filter: Ignore empty strings, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 5fa2f80d4e 057/265: inf-ruby-completions: Pass _pry_ when it's defined, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 2c28bc9f57 060/265: inf-ruby-prompt-format: Include whitespace after rdb prompt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby c5d2178f17 072/265: Add a basic README, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 819e67542a 114/265: inf-ruby-console-gem: really skip directories under lib, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 441cda957c 101/265: Support completion in Pry 1.0.0.pre1, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 8c0aa0911b 118/265: Add "Bugs" section, ELPA Syncer, 2022/07/09