lib/guard/livereload.rb in guard-livereload-0.3.0 vs lib/guard/livereload.rb in guard-livereload-0.3.1
- old
+ new
@@ -4,12 +4,10 @@
module Guard
class LiveReload < Guard
autoload :Reactor, 'guard/livereload/reactor'
- attr_accessor :reactor
-
# =================
# = Guard methods =
# =================
def initialize(watchers = [], options = {})
@@ -33,9 +31,15 @@
end
def run_on_change(paths)
sleep @options[:grace_period]
reactor.reload_browser(paths)
+ end
+
+ private
+
+ def reactor
+ @reactor ||= Reactor.new(@options)
end
end
end