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 +4 -4
- data/lib/guard/livereload.rb +4 -1
- data/lib/guard/livereload/snippet.rb +6 -4
- data/lib/guard/livereload/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bc5708874cfef2c26f815e365761dcdb0f16fdf
|
4
|
+
data.tar.gz: 0dd7de8b38f629768ab335aed0a7a81eddb0a7e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53e0d912b00c1b52327b9d672729c64711277abbb5d843f842414c05e011ff7f0254a8ce25102a8f3e79b0010463a2e242f227bc4bdccab9fabe0b7bb85c1009
|
7
|
+
data.tar.gz: 35a16853fd87104e313f6371a06f6c318dbe546e3adbe9ee48e25545d75a4c969b4b409c29377c576bd80de348fc5d994eba7923a6777f6cfcd227f3f9b0e02d
|
data/lib/guard/livereload.rb
CHANGED
@@ -22,7 +22,10 @@ module Guard
|
|
22
22
|
}.merge(options)
|
23
23
|
|
24
24
|
js_path = @options[:js_template]
|
25
|
-
|
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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|