guard 1.1.0.alpha → 1.1.0.alpha.2

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.
@@ -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
 
@@ -32,6 +32,10 @@ module Guard
32
32
  @options = options
33
33
  end
34
34
 
35
+ def to_s
36
+ "#{@name} group"
37
+ end
38
+
35
39
  end
36
40
 
37
41
  end
@@ -72,6 +72,10 @@ module Guard
72
72
  end
73
73
  end
74
74
 
75
+ def to_s
76
+ self.class.to_s
77
+ end
78
+
75
79
  # Call once when Guard starts. Please override initialize method to init stuff.
76
80
  #
77
81
  # @raise [:task_has_failed] when start has failed
@@ -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
@@ -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
 
@@ -1,4 +1,4 @@
1
1
  module Guard
2
2
  # The current gem version of Guard
3
- VERSION = '1.1.0.alpha'
3
+ VERSION = '1.1.0.alpha.2'
4
4
  end
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 00:00:00.000000000 Z
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.15.2
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.15.2
29
+ version: 0.14.6
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: listen
32
32
  requirement: !ruby/object:Gem::Requirement