Guest User

Untitled

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. (defun merb-console (app host user &optional env working-dir)
  2. "Connect to a remote host and run merb"
  3. (interactive)
  4. (require 'inf-ruby)
  5. (let ((buffer-name-for-comint (concat app "-console"))
  6. (buffer-name (concat "*" app "-console*"))
  7. (env (if env env "production"))
  8. (working-dir (if working-dir working-dir
  9. (concat "/data/" app "/current")))
  10. (cmdlist `("ssh" ,host "-t"
  11. ,(concat "sudo su -l " user " sh -c 'cd "
  12. working-dir " && merb -i -e " env "'"))))
  13. (if (not (comint-check-proc buffer-name))
  14. (set-buffer (apply 'make-comint buffer-name-for-comint
  15. (car cmdlist) nil (cdr cmdlist)))
  16. (inferior-ruby-mode))
  17. (pop-to-buffer buffer-name)))
  18.  
  19. (defun divvs-console ()
  20. (interactive)
  21. (merb-console "divvs" "sh01.divvs.com" "divvs"
  22. "production" "/apps/divvs/current"))
Add Comment
Please, Sign In to add comment