Skip to content

Instantly share code, notes, and snippets.

View Resonious's full-sized avatar
🕶️
💪 👔 🤳

Nigel Baillie Resonious

🕶️
💪 👔 🤳
View GitHub Profile
@Resonious
Resonious / GoToSpec.py
Created August 8, 2014 14:35
Really quick, sloppy (Python isn't my really my jam) sublime text 3 command for switching between spec and implementation in a Rails app.
import sublime, sublime_plugin, os.path, string
class GoToSpecCommand(sublime_plugin.TextCommand):
def run(self, edit):
file_name = self.view.file_name()
if not ('/app/' in file_name or ('/lib/' in file_name and not '/spec/lib/' in file_name)):
if '/spec/lib/' in file_name or '/spec/' in file_name:
file_path = ""
if '/spec/lib/' in file_name: