]> git.eshelyaron.com Git - emacs.git/commitdiff
(ruby-find-library-file): Also recognize 'gem' statements
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 2 Mar 2021 13:16:34 +0000 (15:16 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 2 Mar 2021 13:16:34 +0000 (15:16 +0200)
* lisp/progmodes/ruby-mode.el (ruby-find-library-file):
Also recognize 'gem' statements.

lisp/progmodes/ruby-mode.el

index e7f407b6367f99a4ba892d7eed9b7a2d6e6d6444..3f8afd9705023f34f1f8700d6a297900dcdaae1c 100644 (file)
@@ -1802,12 +1802,12 @@ FEATURE-NAME is a relative file name, file extension is optional.
 This commands delegates to `gem which', which searches both
 installed gems and the standard library.  When called
 interactively, defaults to the feature name in the `require'
-statement around point."
+or `gem' statement around point."
   (interactive)
   (unless feature-name
     (let ((init (save-excursion
                   (forward-line 0)
-                  (when (looking-at "require [\"']\\(.*\\)[\"']")
+                  (when (looking-at "\\(?:require\\| *gem\\) [\"']\\(.*?\\)[\"']")
                     (match-string 1)))))
       (setq feature-name (read-string "Feature name: " init))))
   (let ((out