def run(self): files = self._direct_match() or self._prioritize_by_path() if files: OpenFile(self.context.window(), files).run() elif self._fall_back_to_create_spec(): CreateSpecFile(self.context).run() else: rspec_print("No files found, searched for {0}".format(self._file_base_name()))
def run(self): files = self._direct_match() or self._prioritize_by_path() if files: OpenFile(self.context.window(), files).run() elif self._fall_back_to_create_spec(): CreateSpecFile(self.context).run() else: rspec_print("No files found, searched for {0}".format( self._file_base_name()))
import sys, imp, os from rspec.rspec_print import rspec_print # Dependecy reloader # The original idea is borrowed from # https://github.com/wbond/sublime_package_control/blob/master/package_control/reloader.py rspec_print('Reloading rspec modules') CODE_DIRS = [ 'plugin_helpers', 'rspec', ] PYTHON_FILE_EXT = '.py' def _reload(dir, file): (name, extension) = os.path.splitext(file) if not extension == PYTHON_FILE_EXT: return dirs = '.'.join(filter(None, os.path.split(dir))) module = sys.modules.get('.'.join([dirs, name])) if not module: return if 'on_module_reload' in module.__dict__: module.on_module_reload() imp.reload(module) for _ in range(2): # double reload required to update dependencies for directory in CODE_DIRS: for dir, _, files in os.walk(directory):
def run(self, edit): rspec_print("Creating spec file") context = TaskContext(self, edit) CreateSpecFile(context).run()
def run(self, edit): rspec_print("Switching between code and test") context = TaskContext(self, edit) SwitchBetweenCodeAndTest(context).run()
def run(self, edit): rspec_print("Displaying output panel") context = TaskContext(self, edit) context.display_output_panel()
def run(self, edit): rspec_print("Running last rspec command") context = TaskContext(self, edit) ExecuteSpec(context).last_run()
def run(self, edit): rspec_print("Running rspec") context = TaskContext(self, edit, spec_target_is_file = True) ExecuteSpec(context).current()
def run(self, edit): rspec_print("Running rspec") context = TaskContext(self, edit) ExecuteSpec(context).current()
def run(self, edit): rspec_print("Creating sepc file") context = TaskContext(self, edit) CreateSpecFile(context).run()
import sys, imp, os from rspec.rspec_print import rspec_print # Dependecy reloader # The original idea is borrowed from # https://github.com/wbond/sublime_package_control/blob/master/package_control/reloader.py rspec_print('Reloading rspec modules') CODE_DIRS = [ 'plugin_helpers', 'rspec', ] PYTHON_FILE_EXT = '.py' def _reload(dir, file): (name, extension) = os.path.splitext(file) if not extension == PYTHON_FILE_EXT: return dirs = '.'.join(filter(None, os.path.split(dir))) module = sys.modules.get('.'.join([dirs, name])) if not module: return if 'on_module_reload' in module.__dict__: module.on_module_reload() imp.reload(module) for _ in range(2): # double reload required to update dependencies for directory in CODE_DIRS: for dir, _, files in os.walk(directory): for file in files: _reload(dir, file)