Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Update menus.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmexe committed Mar 5, 2009
1 parent c47425c commit b33172c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
4 changes: 1 addition & 3 deletions bundles/rails-basic-bundle.el
Expand Up @@ -51,9 +51,7 @@
t))

(rails/defbundle "Basic"
(:menu
(([new] (cons "Create a new view for current file" 'identity))
([new2] (cons "Create a new view for current file" 'identity))))
()

(rails/defresource 'controller "Controller"
:dir "app/controllers"
Expand Down
18 changes: 14 additions & 4 deletions bundles/rails-generator-bundle.el
Expand Up @@ -129,18 +129,28 @@
(when-bind (root (rails/root))
(rails/generator-bundle/create-cache root)))

(defun rails/generator-bundle/gen ()
(interactive)
(when-bind (root (rails/root))
(rails/anything/run-with-pattern "gen ")))

(defun rails/generator-bundle/des ()
(interactive)
(when-bind (root (rails/root))
(rails/anything/run-with-pattern "des ")))

;;; ---------------------------------------------------------
;;; - Bundle
;;;

(rails/defbundle "Generator"
(:menu
(([reset] (cons "Reset Cache" 'rails/generator-bundle/reset-cache))
([destroy] (cons "Destroy" 'rails/generator-bundle/destroy))
([create] (cons "Generate" 'rails/generator-bundle/generate)))
([destroy] (cons "Destroy" 'rails/generator-bundle/des))
([create] (cons "Generate" 'rails/generator-bundle/gen)))
:keys
(("e" 'rails/generator-bundle/generate)
("E" 'rails/generator-bundle/destroy))
(("e" 'rails/generator-bundle/gen)
("E" 'rails/generator-bundle/des))
:triggers
(("gen" "Generate"
(candidates
Expand Down
10 changes: 3 additions & 7 deletions bundles/rails-rake-bundle.el
Expand Up @@ -179,7 +179,7 @@
"List of availabled Rake tasks."
(interactive)
(when-bind (root (rails/root))
(anything (rails/anything/load-triggers) "rake")))
(rails/anything/run-with-pattern "rake ")))

;;; ---------------------------------------------------------
;;; - Bundle
Expand All @@ -188,13 +188,9 @@
(rails/defbundle "Rake"
(:menu
(([reset] (cons "Reset Tasks Cache" 'rails/rake-bundle/reset-cache))
([list] (cons "List Tasks" 'rails/rake-bundle/list-tasks))
([task-args] (cons "Run Rake Task with Arguments" 'rails/rake-bundle/run-with-args))
([task] (cons "Run Rake Task" 'rails/rake-bundle/run)))
([task] (cons "Run Rake Task" 'rails/rake-bundle/list-tasks)))
:keys
(("r" 'rails/rake-bundle/run)
("R" 'rails/rake-bundle/run-with-args)
("\C-r" 'rails/rake-bundle/list-tasks))
(("r" 'rails/rake-bundle/anything))
:triggers
(("rake" "Rake Task"
(candidates
Expand Down
2 changes: 1 addition & 1 deletion bundles/rails-webserver-bundle.el
Expand Up @@ -135,7 +135,7 @@
(unless port
(setq port (rails/completing-read "and port"
nil
t
nil
(format "%s" rails/webserver-bundle/port)))
(when (zerop (string-to-number port))
(setq port rails/webserver-bundle/port)))
Expand Down
3 changes: 3 additions & 0 deletions rails-anything.el
Expand Up @@ -170,6 +170,9 @@
t))
(anything result))))

(defun rails/anything/run-with-pattern (pattern)
(anything (rails/anything/load-triggers) pattern))

;;; ---------------------------------------------------------
;;; - advice anything sources
;;;
Expand Down
3 changes: 2 additions & 1 deletion rails-reloaded.el
Expand Up @@ -191,7 +191,8 @@
([rails toggle toggle-test] (cons "Toggle Test/Implementation" 'rails/resources/toggle-test))
([rails toggle toggle] (cons "Toggle" 'rails/resources/toggle))
([rails toggle goto] (cons "Go to..." 'rails/goto-associated))
([rails goto] (cons "Go To" (make-sparse-keymap))))
([rails goto] (cons "Go To" (make-sparse-keymap)))
([rails find] (cons "Find file" 'rails/goto)))
map))

(defun rails-minor-mode-environments-menu (&optional args)
Expand Down

0 comments on commit b33172c

Please sign in to comment.