Created
February 15, 2017 12:50
-
-
Save yoursdearboy/edc88440be7fb50e64cf5860bb53d3a0 to your computer and use it in GitHub Desktop.
Remote Rails console over SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; rails-console-remote.el --- remote rails console over ssh | |
;; Copyright (C) 2016 Kirill Voronin <[email protected]> | |
;; Author: Kirill Voronin <[email protected]> | |
;; Keywords: rails | |
;; Version: 0.0.1 | |
(defun rails-console-remote (&optional host &optional path &optional env &optional user-cmd) | |
"Call `run-ruby'." | |
(interactive "P") | |
(let ((default-cmd '"bundle exec rails console")) | |
(run-ruby | |
(format "/usr/bin/ssh -t %s cd %s; /bin/bash --login -c '%s %s'" | |
(or host (read-string "host: ")) | |
(or path (read-string "path: ")) | |
(if user-cmd user-cmd | |
(read-string "rails console: " default-cmd)) | |
(or env "production"))))) | |
(provide 'rails-console-remote) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment