Help us understand the problem. What is going on with this article?

anythingから、ローカルにあるrubygemsのソースを開く

More than 5 years have passed since last update.

すでに誰か作ってるかもしれんけど、

(defvar anything-c-sources-local-gem-file
  '((name . "gems (local)")
    (candidates-in-buffer)
    (init . (lambda ()
              (unless (anything-candidate-buffer)
                (call-process-shell-command
                 "gem list" nil (anything-candidate-buffer 'global)
                 ))))
    (action . (lambda (gem-name)
                (setq gem-name (replace-regexp-in-string "\s+(.+)$" "" gem-name))
                (with-temp-buffer
                  (call-process "gem" nil t nil "which" gem-name)
                  (let ((path (buffer-substring-no-properties (point-min)
                                                              (- (point-max) 1))))
                    (if (file-exists-p path)
                        (find-file path)
                      (message "no such file or directory:\"%s\"" path))))
                ))))

(defun anything-local-gems ()
  (interactive)
  (anything-other-buffer
   '(anything-c-sources-local-gem-file)
   "*anything local gems*"
  ))

M-x anything-local-gems で、インストールされているgemの一覧が出るので、選ぶと、それのソース開きます。

ffap + devel-whichあればそんなに必要ないか…

hadashiA
フリーランスプログラマだよ
https://twitter.com/hadashiA
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away