[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-ruby 9157d9c561 115/265: inf-ruby-console-gem: when ge
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-ruby 9157d9c561 115/265: inf-ruby-console-gem: when gemspec doesn't modify LOAD_PATH, -I lib |
Date: |
Sat, 9 Jul 2022 21:59:18 -0400 (EDT) |
branch: elpa/inf-ruby
commit 9157d9c56123e8e442ff656946655030d1f47888
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
inf-ruby-console-gem: when gemspec doesn't modify LOAD_PATH, -I lib
---
inf-ruby.el | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/inf-ruby.el b/inf-ruby.el
index fbbffba4dc..1303c5c9f4 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -644,9 +644,13 @@ The main module should be loaded automatically. If DIR
contains a
Gemfile, it should use the `gemspec' instruction."
(interactive "D")
(let* ((default-directory (file-name-as-directory dir))
- (base-command (if (file-exists-p "Gemfile")
- "bundle exec irb"
- "irb -I lib"))
+ (gemspec (car (file-expand-wildcards "*.gemspec")))
+ (base-command
+ (if (file-exists-p "Gemfile")
+ (if (inf-ruby-file-contents-match gemspec "\\$LOAD_PATH")
+ "bundle exec irb"
+ "bundle exec irb -I lib")
+ "irb -I lib"))
files)
(unless (file-exists-p "lib")
(error "The directory must contain a 'lib' subdirectory"))
@@ -671,15 +675,19 @@ Gemfile, it should use the `gemspec' instruction."
(unless (file-exists-p "Gemfile")
(error "The directory must contain a Gemfile"))
(cond
- ((with-temp-buffer
- (insert-file-contents "Gemfile")
- (re-search-forward "[\"']racksh[\"']" nil t))
+ ((inf-ruby-file-contents-match "Gemfile" "[\"']racksh[\"']")
(run-ruby "bundle exec racksh" "racksh"))
((file-exists-p "console.rb")
(run-ruby "ruby console.rb" "console.rb"))
(t
(run-ruby "bundle console")))))
+;;;###autoload
+(defun inf-ruby-file-contents-match (file regexp)
+ (with-temp-buffer
+ (insert-file-contents file)
+ (re-search-forward regexp nil t)))
+
;;;###autoload (dolist (mode ruby-source-modes) (add-hook (intern (format
"%s-hook" mode)) 'inf-ruby-minor-mode))
(provide 'inf-ruby)
- [nongnu] elpa/inf-ruby 05984b3d24 201/265: inf-ruby-console-read-directory: Fix for predicates with wildcards, (continued)
- [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
- [nongnu] elpa/inf-ruby b3747e9574 127/265: Merge pull request #59 from proofit404/master, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 9157d9c561 115/265: inf-ruby-console-gem: when gemspec doesn't modify LOAD_PATH, -I lib,
ELPA Syncer <=
- [nongnu] elpa/inf-ruby 4da1cca555 079/265: Set process filter in inf-ruby-switch-to-compilation, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby a960434970 096/265: run-ruby: write better docstring, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby dbb8d63324 082/265: Add missing license section to comment front-matter, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 27143433e4 083/265: A few doc fixes, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby d91f395070 080/265: Add missing require for thingatpt, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 4c39cd1509 123/265: Fix a couple of compilation warnings, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 00237986d8 130/265: Turn `inf-ruby-implementations` into custom form, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 70da83f8e4 131/265: Merge pull request #54 from wasamasa/feature-defcustom, ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby f6a6b89e08 161/265: Adapting code to use looking-at over re-search-forward., ELPA Syncer, 2022/07/09
- [nongnu] elpa/inf-ruby 505a7bc140 170/265: Merge pull request #84 from janpath/patch-1, ELPA Syncer, 2022/07/09