Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

Commit

Permalink
replacing run-ruby in inf-ruby.el
Browse files Browse the repository at this point in the history
  • Loading branch information
eschulte committed Nov 23, 2008
1 parent 222ab82 commit 2d0eaa4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
31 changes: 30 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Follow any of the following within two lines (up or down)
- submit_tag
- render

* DONE improvements to finders
* TODO improvements to finders
:PROPERTIES:
:suggested-by: vylu
:END:
Expand Down Expand Up @@ -121,6 +121,35 @@ or even better...

*implemented* if no file is found with a find pair, then keep moving.

** TODO complex controllers
:PROPERTIES:
:suggested-by: rejeep
:END:

> But say I have this controller and action:
> class Reports::Nix::UsersController < ReportsController
> def index
> # I am here
> end
> end
>
> And now I do the same thing, trying to find the view:
> M-x rinari-find-view
>
> But no view is found in this case. The corresponding view in this case
> should have been app/views/reports/nix/users/index.html.erb.
>

Hi,

I've never encountered that situation before. It sounds like when going
from a controller to a view splitting the controller name on :: and then
joining the parts as directories would handle this situation. And then
vise-versa going from a view to a controller. I'll try to implement
this and let you know when it's working.

Thanks for the suggestion -- Eric

* DONE upodate documentation for instillation
:PROPERTIES:
:suggested-by: Antti
Expand Down
21 changes: 19 additions & 2 deletions util/inf-ruby.el
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,25 @@ run)."
(setq inf-ruby-buffer buffer-name)
(pop-to-buffer buffer-name)))

(defalias 'run-ruby 'inf-ruby
"An alias for backwards-compatibility.")
(defun run-ruby (cmd)
"Run an inferior Ruby process, input and output via buffer *ruby*.
If there is a process already running in `*ruby*', switch to that buffer.
With argument, allows you to edit the command line (default is value
of `ruby-program-name'). Runs the hooks `inferior-ruby-mode-hook'
\(after the `comint-mode-hook' is run).
\(Type \\[describe-mode] in the process buffer for a list of commands.)"

(interactive (list (if current-prefix-arg
(read-string "Run Ruby: " ruby-program-name)
ruby-program-name)))
(if (not (comint-check-proc "*ruby*"))
(let ((cmdlist (split-string cmd)))
(set-buffer (apply 'make-comint "ruby" (car cmdlist)
nil (cdr cmdlist)))
(inf-ruby-mode)))
(setq ruby-program-name cmd)
(setq ruby-buffer "*ruby*")
(pop-to-buffer "*ruby*"))

(defun inf-ruby-proc ()
"Returns the current IRB process. See variable inf-ruby-buffer."
Expand Down

0 comments on commit 2d0eaa4

Please sign in to comment.