Skip to content

Commit

Permalink
Spruce up
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Feb 17, 2017
1 parent 607596e commit 0117152
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
23 changes: 11 additions & 12 deletions MeteorReval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion MeteorReval.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
4 changes: 2 additions & 2 deletions install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!
3) Now try modifying a file in your meteor server, and enjoy the live updates!

0 comments on commit 0117152

Please sign in to comment.