This repository has been archived by the owner. It is now read-only.
Browse files

replacing run-ruby in inf-ruby.el

  • Loading branch information...
eschulte committed Nov 23, 2008
1 parent 222ab82 commit 2d0eaa470ed481fc662ec9b1858bc645403b141f
Showing with 49 additions and 3 deletions.
  1. +30 −1 TODO
  2. +19 −2 util/inf-ruby.el
@@ -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
:suggested-by: vylu
@@ -121,6 +121,35 @@ or even better...
*implemented* if no file is found with a find pair, then keep moving.
+** TODO complex controllers
+ :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.
+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
:suggested-by: Antti
@@ -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."

0 comments on commit 2d0eaa4

Please sign in to comment.