def on_post_save(self, view): if not is_pubspec(view): return # XXX: This event handler seems to run twice at least on Windows. This # apparently causes an error in pub. Issue has been reported to # SublimeHq just in case. _logger.debug("running pub with %s", view.file_name()) view.window().run_command("dart_pub_get", {"file_name": view.file_name()})
def on_post_save(self, view): if not is_pubspec(view): return # XXX: This event handler seems to run twice at least on Windows. This # apparently causes an error in pub. Issue has been reported to # SublimeHq just in case. _logger.debug("running pub with %s", view.file_name()) view.window().run_command('dart_pub_get', {'file_name': view.file_name()})
def testFailsIfNotAPubspecFile(self): self.assertFalse(is_pubspec(self.view))
def testCanDetectPubspecFileAsPath(self): self.assertTrue(is_pubspec('xxx/pubspec.yaml'))
def testCanDetectPubspecFile(self): view = mock.Mock() view.file_name = mock.Mock(return_value='xxx/pubspec.yaml') self.assertTrue(is_pubspec(view))
def on_post_save(self, view): if not is_pubspec(view): return _logger.debug("running pub with %s", view.file_name()) RunPub(view, view.file_name())