guard-livereload 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +9 -7
- data/lib/guard/livereload.rb +5 -3
- data/lib/guard/livereload/reactor.rb +2 -1
- data/lib/guard/livereload/templates/Guardfile +4 -4
- data/lib/guard/livereload/version.rb +1 -1
- metadata +13 -13
data/README.rdoc
CHANGED
@@ -18,12 +18,12 @@ Add guard definition to your Guardfile by running this command:
|
|
18
18
|
|
19
19
|
guard init livereload
|
20
20
|
|
21
|
-
Install {
|
21
|
+
Install {LiveReload Safari/Chrome extension}[http://github.com/mockko/livereload#readme]
|
22
22
|
|
23
23
|
== Usage
|
24
24
|
|
25
25
|
Please read {guard usage doc}[http://github.com/guard/guard#readme]
|
26
|
-
and {
|
26
|
+
and {LiveReload extension usage doc}[http://github.com/mockko/livereload#readme]
|
27
27
|
|
28
28
|
== Guardfile
|
29
29
|
|
@@ -31,20 +31,22 @@ You can adapt your 'view' files like you want.
|
|
31
31
|
Please read {guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
|
32
32
|
|
33
33
|
guard 'livereload' do
|
34
|
-
watch('
|
35
|
-
watch('
|
36
|
-
watch('
|
37
|
-
watch('
|
34
|
+
watch('app/.+\.(erb|haml)$')
|
35
|
+
watch('app/helpers/.+\.rb$')
|
36
|
+
watch('public/.+\.(css|js|html)$')
|
37
|
+
watch('config/locales/.+\.yml$')
|
38
38
|
end
|
39
39
|
|
40
40
|
== Options
|
41
41
|
|
42
|
-
LiveReload guard have
|
42
|
+
LiveReload guard have five options (host, port, api_version, apply_js_live and apply_css_live):
|
43
43
|
|
44
44
|
guard 'livereload', :port => '35728' do
|
45
45
|
...
|
46
46
|
end
|
47
47
|
|
48
|
+
See {LiveReload configuration doc}[http://github.com/mockko/livereload#readme] for more info about those options.
|
49
|
+
|
48
50
|
== Development
|
49
51
|
|
50
52
|
- Source hosted at {GitHub}[http://github.com/guard/guard-livereload]
|
data/lib/guard/livereload.rb
CHANGED
@@ -8,9 +8,11 @@ module Guard
|
|
8
8
|
attr_accessor :reactor
|
9
9
|
|
10
10
|
def start
|
11
|
-
options[:api_version]
|
12
|
-
options[:host]
|
13
|
-
options[:port]
|
11
|
+
options[:api_version] ||= '1.4'
|
12
|
+
options[:host] ||= '0.0.0.0'
|
13
|
+
options[:port] ||= '35729'
|
14
|
+
options[:apply_js_live] ||= true
|
15
|
+
options[:apply_css_live] ||= true
|
14
16
|
|
15
17
|
@reactor = Reactor.new(options)
|
16
18
|
end
|
@@ -9,6 +9,7 @@ module Guard
|
|
9
9
|
|
10
10
|
def initialize(options)
|
11
11
|
@web_sockets = []
|
12
|
+
@options = options
|
12
13
|
@thread = start_threaded_reactor(options)
|
13
14
|
end
|
14
15
|
|
@@ -19,7 +20,7 @@ module Guard
|
|
19
20
|
def reload_browser(paths = [])
|
20
21
|
UI.info "Reloading browser: #{paths.join(' ')}"
|
21
22
|
paths.each do |path|
|
22
|
-
data = ['refresh', { :path => path, :apply_js_live =>
|
23
|
+
data = ['refresh', { :path => path, :apply_js_live => @options[:apply_js_live], :apply_css_live => @options[:apply_css_live] }].to_json
|
23
24
|
UI.debug data
|
24
25
|
@web_sockets.each { |ws| ws.send(data) }
|
25
26
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
guard 'livereload' do
|
2
|
-
watch('
|
3
|
-
watch('
|
4
|
-
watch('
|
5
|
-
watch('
|
2
|
+
watch('app/.+\.(erb|haml)$')
|
3
|
+
watch('app/helpers/.+\.rb$')
|
4
|
+
watch('public/.+\.(css|js|html)$')
|
5
|
+
watch('config/locales/.+\.yml$')
|
6
6
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-livereload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thibaud Guillaume-Gentil
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-06 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -72,12 +72,12 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
hash:
|
75
|
+
hash: 25
|
76
76
|
segments:
|
77
77
|
- 1
|
78
78
|
- 0
|
79
|
-
-
|
80
|
-
version: 1.0.
|
79
|
+
- 7
|
80
|
+
version: 1.0.7
|
81
81
|
type: :development
|
82
82
|
version_requirements: *id004
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -88,12 +88,12 @@ dependencies:
|
|
88
88
|
requirements:
|
89
89
|
- - ~>
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
hash:
|
91
|
+
hash: 9
|
92
92
|
segments:
|
93
93
|
- 0
|
94
94
|
- 1
|
95
|
-
-
|
96
|
-
version: 0.1.
|
95
|
+
- 9
|
96
|
+
version: 0.1.9
|
97
97
|
type: :development
|
98
98
|
version_requirements: *id005
|
99
99
|
- !ruby/object:Gem::Dependency
|
@@ -104,12 +104,12 @@ dependencies:
|
|
104
104
|
requirements:
|
105
105
|
- - ~>
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
hash:
|
107
|
+
hash: 7
|
108
108
|
segments:
|
109
109
|
- 2
|
110
|
+
- 2
|
110
111
|
- 0
|
111
|
-
|
112
|
-
version: 2.0.0
|
112
|
+
version: 2.2.0
|
113
113
|
type: :development
|
114
114
|
version_requirements: *id006
|
115
115
|
description: Guard::LiveReload automatically reload your browser when 'view' files are modified.
|