From 7543e2090e10e2d664a6f05676dfe8293eaeb9a4 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Thu, 8 Aug 2013 09:26:31 +0100 Subject: [PATCH] Find rails in RAILS_ROOT/bin, for Rails 4.0 (see #73) --- rinari.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/rinari.el b/rinari.el index ac36c28..df961fb 100644 --- a/rinari.el +++ b/rinari.el @@ -327,11 +327,12 @@ arguments." (defun rinari--rails-path () "Return the path of the 'rails' command, or nil if not found." - (let* ((script (rinari-script-path)) - (rails-script (expand-file-name "rails" script))) - (if (file-exists-p rails-script) - rails-script - (executable-find "rails")))) + (let* ((script-rails (expand-file-name "rails" (rinari-script-path))) + (bin-rails (expand-file-name "rails" (rinari-bin-path)))) + (cond + ((file-exists-p bin-rails) bin-rails) + ((file-exists-p script-rails) script-rails) + (t (executable-find "rails"))))) (defun rinari--wrap-rails-command (command) "Given a COMMAND such as 'console', return a suitable command line. @@ -532,6 +533,10 @@ With optional prefix argument ARG, just run `rgrep'." "Return the absolute path to the script folder." (concat (file-name-as-directory (expand-file-name "script" (rinari-root))))) +(defun rinari-bin-path () + "Return the absolute path to the bin folder." + (concat (file-name-as-directory (expand-file-name "bin" (rinari-root))))) + ;;-------------------------------------------------------------------- ;; rinari movement using jump.el