Last active
December 16, 2015 23:19
-
-
Save hungrymedia/5512955 to your computer and use it in GitHub Desktop.
Sublime Text 'restart rails' plugin
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
# mild modification of http://git.io/7oalcQ | |
# save in ~/Library/Application Support/Sublime Text 2/Packages/User/ | |
import sublime, sublime_plugin | |
import os, time | |
class Restart_railsCommand(sublime_plugin.TextCommand): | |
"""Touch tmp/restart.txt file in the rails project to restart app""" | |
def run(self, edit): | |
for folder in self.view.window().folders(): | |
fname = os.path.join(str(folder), 'tmp', 'restart.txt') | |
if os.path.exists(fname): | |
os.utime(fname, None) | |
sublime.status_message('Successfully restarted rails app') | |
""" add the following to your User key bindings | |
{ "keys": ["ctrl+shift+r"], "command": "restart_rails" } | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment