コード例 #1
0
    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()})
コード例 #2
0
    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()})
コード例 #3
0
 def testFailsIfNotAPubspecFile(self):
     self.assertFalse(is_pubspec(self.view))
コード例 #4
0
 def testCanDetectPubspecFileAsPath(self):
     self.assertTrue(is_pubspec('xxx/pubspec.yaml'))
コード例 #5
0
 def testCanDetectPubspecFile(self):
     view = mock.Mock()
     view.file_name = mock.Mock(return_value='xxx/pubspec.yaml')
     self.assertTrue(is_pubspec(view))
コード例 #6
0
    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())