Skip to content

Commit

Permalink
Make ruby-compilation-extract-output-matches public for use in rinari…
Browse files Browse the repository at this point in the history
… and elsewhere
  • Loading branch information
purcell committed Nov 11, 2012
1 parent 49bdf3b commit 7f5c120
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/ruby-compilation.el
Expand Up @@ -204,12 +204,12 @@ buffer."

;;; Special handling for rake and capistrano

(defun ruby-compilation--extract-matches (command pattern)
(defun ruby-compilation-extract-output-matches (command pattern)
"Run COMMAND, and return all the matching strings for PATTERN."
(delq nil (mapcar #'(lambda(line)
(when (string-match pattern line)
(match-string 1 line)))
(split-string (shell-command-to-string command) "[\n]"))))
(split-string (shell-command-to-string command) "[\n]"))))

(defun ruby-compilation--format-env-vars (pairs)
"Convert PAIRS of (name . value) into a list of name=value strings."
Expand All @@ -219,7 +219,7 @@ buffer."

(defun pcmpl-rake-tasks ()
"Return a list of all the rake tasks defined in the current projects."
(ruby-compilation--extract-matches "rake -T" "rake \\([^ ]+\\)"))
(ruby-compilation-extract-output-matches "rake -T" "rake \\([^ ]+\\)"))

;;;###autoload
(defun pcomplete/rake ()
Expand Down Expand Up @@ -248,7 +248,7 @@ optional list of (name . value) pairs which will be passed to rake."

(defun pcmpl-cap-tasks ()
"Return a list of all the cap tasks defined in the current project."
(ruby-compilation--extract-matches "cap -T" "cap \\([^ ]+\\)"))
(ruby-compilation-extract-output-matches "cap -T" "cap \\([^ ]+\\)"))

;;;###autoload
(defun pcomplete/cap ()
Expand Down

0 comments on commit 7f5c120

Please sign in to comment.