mr-sparkle 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - "1.9.3"
4
+ - "2.0.0"
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.2.0
2
+
3
+ * Allow polling to be forced on with --force-polling. If you have mounted the files over NFS, and are editing them remotely, then file system events are not fired, so the reloading doesn't work. Force it to poll with --force-polling and it will work in this case. (Jamie Cobbett)
4
+
1
5
  ### 0.1.0
2
6
 
3
7
  * Changes for compatibility with listen 1.0 and later, which it now requires.
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Mr. Sparkle - The Magical Reloading Rack Server
2
2
 
3
+ [![Build Status](https://travis-ci.org/MicahChalmer/mr-sparkle.png)](https://travis-ci.org/MicahChalmer/mr-sparkle)
4
+
3
5
  This gem contains a script to start a [Unicorn](http://unicorn.bogomips.org/)-based server for your [Rack](http://rack.github.com/) application that reloads your application code automatically when its files are changed, but doesn't incur the penalty of reloading all the gem dependencies. It's based on Jonathan D. Stott's blog post ["Magical Reloading Sparkles"](http://namelessjon.posterous.com/magical-reloading-sparkles)--hence the name. (The name is also a Simpsons reference. [CAN YOU SEE THAT I AM SERIOUS?](http://www.youtube.com/watch?v=dnaLRbbc-54))
4
6
 
5
7
  The main purpose of this gem is to take Jonathan's idea and package it into something can "just work" without having to be customized inside each project's code. Besides the gem packaging, this code differs from the original watcher script in the following ways:
@@ -24,12 +26,14 @@ in your project's root directory. You'll get a server listening on port 8080 (b
24
26
 
25
27
  You can use command-line options to change the behavior a bit as follows:
26
28
 
27
- $ mr-sparkle [--pattern regex] [--full-reload-pattern regex] [-- [unicorn options]]
29
+ $ mr-sparkle [--pattern regex] [--full-reload-pattern regex] [--force-polling] [-- [unicorn options]]
28
30
 
29
31
  Use `--pattern` to replace the default regex that files must match to trigger a reload. I've tried to make the default fairly liberal--it includes all extensions registered with [tilt](https://github.com/rtomayko/tilt/), for instance--so for most apps it will probably work fine.
30
32
 
31
33
  Use `--full-reload-pattern` to trigger a full reload for a different set of files. By default it only does this for `Gemfile.`
32
34
 
35
+ Use `--force-polling` to use polling, rather than using file system events. This is useful if you have mounted the files over NFS, in which case events don't work. By default this is turned off.
36
+
33
37
  Any arguments after the `--` will be passed on to unicorn. This is how you would change the default port, make it not bind to external ip addresses, use a rackup file with a name other than `config.ru`, etc. See [the unicorn documentation](http://unicorn.bogomips.org/unicorn_1.html) for exactly what you can pass here. Do not pass the `-c` option to unicorn--`mr-sparkle` comes with its own unicorn config file that it will use automatically.
34
38
 
35
39
  ## Requirements
@@ -14,6 +14,11 @@ OptionParser.new do |opts|
14
14
  "By default:\n #{Mr::Sparkle::DEFAULT_FULL_RELOAD_PATTERN.to_s}") do |rx|
15
15
  options[:full] = rx
16
16
  end
17
+ opts.on("--force-polling",
18
+ "Force polling if events aren't working (eg your directory is mounted with NFS). " +
19
+ "Default: false") do |rx|
20
+ options[:force_polling] = rx
21
+ end
17
22
  end.parse!
18
23
 
19
24
  Mr::Sparkle::Daemon.new.run(options, ARGV)
@@ -19,8 +19,9 @@ module Mr
19
19
  def run(options, unicorn_args)
20
20
  reload_pattern = options[:pattern] || DEFAULT_RELOAD_PATTERN
21
21
  full_reload_pattern = options[:full] || DEFAULT_FULL_RELOAD_PATTERN
22
+ force_polling = options[:force_polling] || false
22
23
  @unicorn_args = unicorn_args
23
- listener = Listen.to(Dir.pwd, :relative_paths=>true)
24
+ listener = Listen.to(Dir.pwd, :relative_paths=>true, :force_polling=>force_polling)
24
25
  listener.filter(full_reload_pattern)
25
26
  listener.filter(reload_pattern)
26
27
  listener.change do |modified, added, removed|
@@ -1,5 +1,5 @@
1
1
  module Mr
2
2
  module Sparkle
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mr-sparkle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-24 00:00:00.000000000 Z
12
+ date: 2013-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: unicorn