lib/guard/livereload.rb in guard-livereload-2.5.0 vs lib/guard/livereload.rb in guard-livereload-2.5.1
- old
+ new
@@ -20,10 +20,13 @@
grace_period: 0,
js_template: js_path
}.merge(options)
js_path = @options[:js_template]
- @options[:livereload_js_path] = Snippet.new(js_path, @options).path
+
+ # NOTE: save snippet as instvar, so it's not GC'ed
+ @snippet = Snippet.new(js_path, @options)
+ @options[:livereload_js_path] = @snippet.path
end
def start
@reactor = Reactor.new(options)
end