guard 1.1.0.alpha → 1.1.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/guard.rb +5 -3
- data/lib/guard/group.rb +4 -0
- data/lib/guard/guard.rb +4 -0
- data/lib/guard/interactor.rb +1 -11
- data/lib/guard/ui.rb +13 -0
- data/lib/guard/version.rb +1 -1
- metadata +6 -6
data/lib/guard.rb
CHANGED
@@ -160,19 +160,20 @@ module Guard
|
|
160
160
|
# Stop Guard listening to file changes
|
161
161
|
#
|
162
162
|
def stop
|
163
|
+
UI.info 'Bye bye...', :reset => true
|
163
164
|
interactor.stop if interactor
|
164
165
|
listener.stop
|
165
166
|
runner.run(:stop)
|
166
|
-
|
167
|
-
UI.info 'Bye bye...', :reset => true
|
168
167
|
end
|
169
168
|
|
170
|
-
# Reload all Guards currently enabled.
|
169
|
+
# Reload Guardfile and all Guards currently enabled.
|
171
170
|
#
|
172
171
|
# @param [Hash] scopes an hash with a guard or a group scope
|
173
172
|
#
|
174
173
|
def reload(scopes)
|
175
174
|
UI.clear
|
175
|
+
UI.action_with_scopes('Reload', scopes)
|
176
|
+
Dsl.reevaluate_guardfile if scopes.empty?
|
176
177
|
runner.run(:reload, scopes)
|
177
178
|
end
|
178
179
|
|
@@ -182,6 +183,7 @@ module Guard
|
|
182
183
|
#
|
183
184
|
def run_all(scopes)
|
184
185
|
UI.clear
|
186
|
+
UI.action_with_scopes('Run', scopes)
|
185
187
|
runner.run(:run_all, scopes)
|
186
188
|
end
|
187
189
|
|
data/lib/guard/group.rb
CHANGED
data/lib/guard/guard.rb
CHANGED
data/lib/guard/interactor.rb
CHANGED
@@ -127,7 +127,7 @@ module Guard
|
|
127
127
|
when :pause
|
128
128
|
::Guard.pause
|
129
129
|
when :reload
|
130
|
-
reload(scopes)
|
130
|
+
::Guard.reload(scopes)
|
131
131
|
when :run_all
|
132
132
|
::Guard.run_all(scopes)
|
133
133
|
when :notification
|
@@ -137,16 +137,6 @@ module Guard
|
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
-
# Execute the reload action.
|
141
|
-
#
|
142
|
-
# @param [Hash] scopes the reload scopes
|
143
|
-
#
|
144
|
-
def reload(scopes)
|
145
|
-
::Guard::UI.info 'Reload'
|
146
|
-
::Guard::Dsl.reevaluate_guardfile if scopes.empty?
|
147
|
-
::Guard.reload(scopes)
|
148
|
-
end
|
149
|
-
|
150
140
|
# Toggle the system notifications on/off
|
151
141
|
#
|
152
142
|
def toggle_notification
|
data/lib/guard/ui.rb
CHANGED
@@ -83,6 +83,19 @@ module Guard
|
|
83
83
|
def clear
|
84
84
|
system('clear;') if ::Guard.options[:clear]
|
85
85
|
end
|
86
|
+
|
87
|
+
# Show a scoped action message.
|
88
|
+
#
|
89
|
+
# @param [String] action the action to show
|
90
|
+
# @param [Hash] scopes an hash with a guard or a group scope
|
91
|
+
#
|
92
|
+
def action_with_scopes(action, scopes)
|
93
|
+
scope_message ||= scopes[:guard]
|
94
|
+
scope_message ||= scopes[:group]
|
95
|
+
scope_message ||= 'all'
|
96
|
+
|
97
|
+
info "#{action} #{scope_message}"
|
98
|
+
end
|
86
99
|
|
87
100
|
private
|
88
101
|
|
data/lib/guard/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.alpha
|
4
|
+
version: 1.1.0.alpha.2
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,24 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.14.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.14.6
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: listen
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|