1
;;; rails-find.el ---
2
3
;; Copyright (C) 2006 Dmitry Galinsky <dima dot exe at gmail dot com>
4
5
;; Authors: Dmitry Galinsky <dima dot exe at gmail dot com>,
6
;;          Rezikov Peter <crazypit13 (at) gmail.com>
7
8
;; Keywords: ruby rails languages oop
9
;; $URL: svn+ssh://rubyforge/var/svn/emacs-rails/trunk/rails-navigation.el $
10
;; $Id: rails-navigation.el 111 2007-03-24 22:28:12Z dimaexe $
11
12
;;; License
13
14
;; This program is free software; you can redistribute it and/or
15
;; modify it under the terms of the GNU General Public License
16
;; as published by the Free Software Foundation; either version 2
17
;; of the License, or (at your option) any later version.
18
19
;; This program is distributed in the hope that it will be useful,
20
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
;; GNU General Public License for more details.
23
24
;; You should have received a copy of the GNU General Public License
25
;; along with this program; if not, write to the Free Software
26
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27
28
(defmacro rails-find:gen (name dir)
29
  "Define new rails-find function"
30
  (let ((dir (concat dir "/")))
31
    `(defun ,(intern (concat "rails-find:" name)) ()
32
       ,(format "Run find-file in Rails \"%s\" dir" dir)
33
       (interactive)
34
       (let ((default-directory (rails-core:file ,dir)))
35
         (call-interactively ',(if (fboundp 'ido-find-file)
36
                                   'ido-find-file
37
                                 'find-file))))))
38
39
(rails-find:gen "controller"  "app/controllers")
40
(rails-find:gen "view"        "app/views")
41
(rails-find:gen "layout"      "app/views/layouts")
42
(rails-find:gen "db"          "db")
43
(rails-find:gen "public"      "public")
44
(rails-find:gen "helpers"     "app/helpers")
45
(rails-find:gen "models"      "app/models")
46
(rails-find:gen "config"      "config")
47
(rails-find:gen "lib"         "lib")
48
(rails-find:gen "tasks"       "lib/tasks")
49
(rails-find:gen "stylesheets" "public/stylesheets")
50
(rails-find:gen "javascripts" "public/javascripts")
51
(rails-find:gen "migrate"     "db/migrate")
52
(rails-find:gen "fixtures"    "test/fixtures")
53
54
;; Rspec
55
(rails-find:gen "spec" "spec/")
56
(rails-find:gen "spec-controllers" "spec/controllers/")
57
(rails-find:gen "spec-models" "spec/models/")
58
(rails-find:gen "spec-helpers" "spec/views/")
59
(rails-find:gen "spec-helpers" "spec/helpers/")
60
(rails-find:gen "spec-fixtures" "spec/fixtures/")
61
62
(provide 'rails-find)