Skip to content

Commit

Permalink
Find rails in RAILS_ROOT/bin, for Rails 4.0 (see #73)
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Aug 8, 2013
1 parent 2530ea7 commit 7543e20
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions rinari.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7543e20

Please sign in to comment.