guard-livereload 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cda44c14816be8446e496f2ea2c306ce3ac400bb
4
- data.tar.gz: d2d202a0411cea1a4259a859486464e4625900a0
3
+ metadata.gz: 8bc5708874cfef2c26f815e365761dcdb0f16fdf
4
+ data.tar.gz: 0dd7de8b38f629768ab335aed0a7a81eddb0a7e5
5
5
  SHA512:
6
- metadata.gz: 481750e4e5618b791b2dcc94eaa33f98a9fff4b319deefa994d020fe9b2fb093ef37ff8c87ca1eb12add769c10f03bbd6bfc9676d7dbe6f44440406963a322cc
7
- data.tar.gz: 68e2276c433dc2dbaea45a369b3c924e4cd599c2e48a9d1dd69b1ae9d975602759e3160d07e6552a0519d074accaf4f451574041b475dde9d7bdda7bca50c327
6
+ metadata.gz: 53e0d912b00c1b52327b9d672729c64711277abbb5d843f842414c05e011ff7f0254a8ce25102a8f3e79b0010463a2e242f227bc4bdccab9fabe0b7bb85c1009
7
+ data.tar.gz: 35a16853fd87104e313f6371a06f6c318dbe546e3adbe9ee48e25545d75a4c969b4b409c29377c576bd80de348fc5d994eba7923a6777f6cfcd227f3f9b0e02d
@@ -22,7 +22,10 @@ module Guard
22
22
  }.merge(options)
23
23
 
24
24
  js_path = @options[:js_template]
25
- @options[:livereload_js_path] = Snippet.new(js_path, @options).path
25
+
26
+ # NOTE: save snippet as instvar, so it's not GC'ed
27
+ @snippet = Snippet.new(js_path, @options)
28
+ @options[:livereload_js_path] = @snippet.path
26
29
  end
27
30
 
28
31
  def start
@@ -11,12 +11,14 @@ module Guard
11
11
 
12
12
  def initialize(template, options)
13
13
  @options = options # for ERB context
14
- tmpfile = Tempfile.new('livereload.js')
14
+
15
+ # NOTE: use instance variable for Tempfile, so it's not GC'ed before sending
16
+ @tmpfile = Tempfile.new('livereload.js')
15
17
  source = IO.read(template)
16
18
  data = ERB.new(source).result(binding)
17
- tmpfile.write(data)
18
- tmpfile.close
19
- @path = tmpfile.path
19
+ @tmpfile.write(data)
20
+ @tmpfile.close
21
+ @path = @tmpfile.path
20
22
  end
21
23
  end
22
24
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module LiveReloadVersion
3
- VERSION = '2.5.0'
3
+ VERSION = '2.5.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-livereload
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard