Skip to content

Instantly share code, notes, and snippets.

@trabianmatt
Created January 8, 2013 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trabianmatt/4480411 to your computer and use it in GitHub Desktop.
Save trabianmatt/4480411 to your computer and use it in GitHub Desktop.
Restart passenger
import sublime, sublime_plugin
import os, time
class RestartPassengerCommand(sublime_plugin.TextCommand):
"""Touch tmp/restart.txt file in the rails project to restart pasenger"""
def run(self, edit):
for folder in self.view.window().folders():
fname = os.path.join(str(folder), 'tmp', 'restart.txt')
if os.path.exists(os.path.dirname(fname)):
with file(fname, 'a'):
os.utime(fname, None)
sublime.status_message('Successfully touched tmp/restart.txt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment