From 0117152ae3ff1163c2a3a4a608c7eb33caa5842e Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Fri, 17 Feb 2017 15:24:45 -0500 Subject: [PATCH] Spruce up --- MeteorReval.py | 23 +++++++++++------------ MeteorReval.sublime-settings | 2 +- README.md | 10 +++++----- install.txt | 4 ++-- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/MeteorReval.py b/MeteorReval.py index 8440bd2..832a88b 100755 --- a/MeteorReval.py +++ b/MeteorReval.py @@ -17,27 +17,26 @@ def handleTimeout(self, view): def on_modified_async(self, view): if settings.get('reload_on_modified') is True: - required_path = settings.get('required_path') + + required_path = settings.get('required_path') required_regex = settings.get('required_regex') - file_path = view.file_name() - print (file_path) + file_path = view.file_name() + if (file_path and file_path.find(required_path) >= 0 and re.search(required_regex, file_path)): self.pending = self.pending + 1 - print ('here') sublime.set_timeout(functools.partial(self.handleTimeout, view), settings.get('reload_debounce')) class meteorRevalCommand(sublime_plugin.TextCommand): def run(self, view): if (self.view.file_name()): - path = settings.get('path') - file_path = self.view.file_name().replace(path, '') - hostname = settings.get('hostname') - port = settings.get('port') - endpoint = settings.get('endpoint') - url = 'http://' + hostname + ':' + str(port) + endpoint + '?filePath=' + file_path + path = settings.get('path') + hostname = settings.get('hostname') + port = settings.get('port') + endpoint = settings.get('endpoint') + url = 'http://' + hostname + ':' + str(port) + endpoint + '?filePath=' + self.view.file_name().replace(path, '') print (url) - data = self.view.substr(sublime.Region(0, self.view.size())) - request = HttpAsyncRequest(url) + data = self.view.substr(sublime.Region(0, self.view.size())) + request = HttpAsyncRequest(url) request.set_content(str.encode(data)) request.set_header('Content-type', 'text/plain') request.send() diff --git a/MeteorReval.sublime-settings b/MeteorReval.sublime-settings index e37f672..9289dff 100755 --- a/MeteorReval.sublime-settings +++ b/MeteorReval.sublime-settings @@ -12,7 +12,7 @@ "port": 3000, // The name of the server endpoint - "endpoint" : "/reval", + "endpoint" : "/reval/reload", // Path to the root of the meteor server (windows be sure to escape backslashes, i.e. "C:\\My\\Project") "path": "", diff --git a/README.md b/README.md index d1867a6..828b3bb 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## Live Reloads with Meteor +## Meteor Reval - Instant Reloading with Sublime & Meteor -This plugin is for use in combination with [Reval](https://github.com/qualialabs/reval) to allow for instant reloads with Meteor. +This plugin is for use in combination with [Reval](https://github.com/qualialabs/reval) to allow for instant reloads with Meteor. ### Meteor Setup @@ -9,6 +9,6 @@ This plugin is for use in combination with [Reval](https://github.com/qualialabs ### Sublime Setup Until we're approved by package manager you'll have to manually grab the files from this repo -* `Shift + Command + P` to launch to open Sublime's command bar -* Goto `Package Control: Add Repository` -* Enter `https://github.com/qualialabs/reval-sublime.git` +* Choose "download zip" from GitHub +* In sublime go to preferences -> browse packages +* Extract repository into package directory diff --git a/install.txt b/install.txt index d310352..d1b9b98 100755 --- a/install.txt +++ b/install.txt @@ -6,8 +6,8 @@ meteor add qualia:reval 2) Set local path for this plugin -Preferences -> Package Settings -> Meteor Reload -> "Settings - User" +Preferences -> Package Settings -> Meteor Reval -> "Settings - User" This path should correspond to the root of your meteor project locally. -3) Now try modifying a file in your meteor server, and enjoy the live updates! \ No newline at end of file +3) Now try modifying a file in your meteor server, and enjoy the live updates!