Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun merb-console (app host user &optional env working-dir)
- "Connect to a remote host and run merb"
- (interactive)
- (require 'inf-ruby)
- (let ((buffer-name-for-comint (concat app "-console"))
- (buffer-name (concat "*" app "-console*"))
- (env (if env env "production"))
- (working-dir (if working-dir working-dir
- (concat "/data/" app "/current")))
- (cmdlist `("ssh" ,host "-t"
- ,(concat "sudo su -l " user " sh -c 'cd "
- working-dir " && merb -i -e " env "'"))))
- (if (not (comint-check-proc buffer-name))
- (set-buffer (apply 'make-comint buffer-name-for-comint
- (car cmdlist) nil (cdr cmdlist)))
- (inferior-ruby-mode))
- (pop-to-buffer buffer-name)))
- (defun divvs-console ()
- (interactive)
- (merb-console "divvs" "sh01.divvs.com" "divvs"
- "production" "/apps/divvs/current"))
Add Comment
Please, Sign In to add comment