guard 2.0.0.pre.3 → 2.0.0.pre.4

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: 97231e4fc0839c1025501eaf13e0577f9f53c002
4
- data.tar.gz: 07f0d463dd0a08e1aa4480ecbada67db32035e37
3
+ metadata.gz: 8025e7f0ec625bbce9aca160a9ffd51d71f26c56
4
+ data.tar.gz: fdcd36acb0a257c89429d602a01a73114afb243c
5
5
  SHA512:
6
- metadata.gz: 6647423b6451e4dd2ccb864240a4a881bf86a20bd1673d547c4f0fdd1285a25004e2604390c8480c60fa60a1fa0a4b436629755665a0f1ef25365c1a9d368d65
7
- data.tar.gz: 969be72dd8aeb2eca0f55255fa24e886a7b4cfd4cd31059ec1e26cca2075233c6e9d35f886fea10eae68f88e61cd6b03f0413ff736cb1071f5cf71d0102e91fc
6
+ metadata.gz: 4d050af1881b99fccfb8d8e9195dddd2c8c189feeb4f7008141414db6789fcfa8c712161981fcfa8f9d2b4ddef183e36faf63cf4f415eac67a67860c4f5c2277
7
+ data.tar.gz: 60ab1d3b0b0469cf29dad122a7c4be3f1d94549f8be86e475b9d43d44ef77ab98c6d18834c1a96172b26c52119bbf396abba0dc2ffbfea7ee29b8d99deb0915a
data/README.md CHANGED
@@ -54,10 +54,9 @@ $ bundle
54
54
  Generate an empty `Guardfile` with:
55
55
 
56
56
  ```bash
57
- $ guard init
57
+ $ bundle exec guard init
58
58
  ```
59
59
 
60
-
61
60
  Run Guard through Bundler with:
62
61
 
63
62
  ```bash
@@ -97,14 +96,14 @@ Guard is run from the command line. Please open your terminal and go to your pro
97
96
  You can always get help on the available tasks with the `help` task:
98
97
 
99
98
  ```bash
100
- $ guard help
99
+ $ bundle exec guard help
101
100
  ```
102
101
 
103
102
  Requesting more detailed help on a specific task is simple: just append the task name to the help task.
104
103
  For example, to get help for the `start` task, simply run:
105
104
 
106
105
  ```bash
107
- $ guard help start
106
+ $ bundle exec guard help start
108
107
  ```
109
108
 
110
109
  ### Init
@@ -113,28 +112,28 @@ You can generate a Guardfile and have all installed plugins be automatically add
113
112
  it by running the `init` task without any option:
114
113
 
115
114
  ```bash
116
- $ guard init
115
+ $ bundle exec guard init
117
116
  ```
118
117
 
119
118
  You can also specify the name of an installed plugin to only get that plugin template
120
119
  in the generated Guardfile:
121
120
 
122
121
  ```bash
123
- $ guard init <guard-name>
122
+ $ bundle exec guard init <guard-name>
124
123
  ```
125
124
 
126
125
  You can also specify the names of multiple plugins to only get those plugin templates
127
126
  in the generated Guardfile:
128
127
 
129
128
  ```bash
130
- $ guard init <guard1-name> <guard2-name>
129
+ $ bundle exec guard init <guard1-name> <guard2-name>
131
130
  ```
132
131
 
133
132
  You can also define your own templates in `~/.guard/templates/` which can be appended in the same way to your existing
134
133
  `Guardfile`:
135
134
 
136
135
  ```bash
137
- $ guard init <template-name>
136
+ $ bundle exec guard init <template-name>
138
137
  ```
139
138
 
140
139
  **Note**: If you already have a `Guardfile` in the current directory, the `init` task can be used
@@ -146,8 +145,8 @@ You can generate an empty `Guardfile` by running the `init` task with the bare
146
145
  option:
147
146
 
148
147
  ```bash
149
- $ guard init --bare
150
- $ guard init -b # shortcut
148
+ $ bundle exec guard init --bare
149
+ $ bundle exec guard init -b # shortcut
151
150
  ```
152
151
 
153
152
  ### Start
@@ -155,7 +154,7 @@ $ guard init -b # shortcut
155
154
  Just launch Guard inside your Ruby or Rails project with:
156
155
 
157
156
  ```bash
158
- $ guard
157
+ $ bundle exec guard
159
158
  ```
160
159
 
161
160
  Guard will look for a `Guardfile` in your current directory. If it does not find one, it will look in your `$HOME`
@@ -166,8 +165,8 @@ directory for a `.Guardfile`.
166
165
  The shell can be cleared after each change:
167
166
 
168
167
  ```bash
169
- $ guard --clear
170
- $ guard -c # shortcut
168
+ $ bundle exec guard --clear
169
+ $ bundle exec guard -c # shortcut
171
170
  ```
172
171
 
173
172
  You can add the following snippet to your `~/.guardrc` to have the clear option always be enabled:
@@ -181,8 +180,8 @@ Guard.options.clear = true
181
180
  System notifications can be disabled:
182
181
 
183
182
  ```bash
184
- $ guard --notify false
185
- $ guard -n f # shortcut
183
+ $ bundle exec guard --notify false
184
+ $ bundle exec guard -n f # shortcut
186
185
  ```
187
186
 
188
187
  Notifications can also be disabled globally by setting a `GUARD_NOTIFY` environment variable to `false`.
@@ -192,8 +191,8 @@ Notifications can also be disabled globally by setting a `GUARD_NOTIFY` environm
192
191
  Scope Guard to certain plugin groups on start:
193
192
 
194
193
  ```bash
195
- $ guard --group group_name another_group_name
196
- $ guard -g group_name another_group_name # shortcut
194
+ $ bundle exec guard --group group_name another_group_name
195
+ $ bundle exec guard -g group_name another_group_name # shortcut
197
196
  ```
198
197
 
199
198
  See the Guardfile DSL below for creating groups.
@@ -203,8 +202,8 @@ See the Guardfile DSL below for creating groups.
203
202
  Scope Guard to certain plugins on start:
204
203
 
205
204
  ```bash
206
- $ guard --plugins plugin_name another_plugin_name
207
- $ guard -P plugin_name another_plugin_name # shortcut
205
+ $ bundle exec guard --plugins plugin_name another_plugin_name
206
+ $ bundle exec guard -P plugin_name another_plugin_name # shortcut
208
207
  ```
209
208
 
210
209
  #### `-d`/`--debug` option
@@ -213,8 +212,8 @@ Guard can display debug information which can be very usefull for plugins
213
212
  developers with:
214
213
 
215
214
  ```bash
216
- $ guard --debug
217
- $ guard -d # shortcut
215
+ $ bundle exec guard --debug
216
+ $ bundle exec guard -d # shortcut
218
217
  ```
219
218
 
220
219
  #### `-w`/`--watchdir` option
@@ -222,9 +221,9 @@ $ guard -d # shortcut
222
221
  Guard can watch any number of directories instead of only the current directory:
223
222
 
224
223
  ```bash
225
- $ guard --watchdir ~/your/fancy/project
226
- $ guard -w ~/your/fancy/project ~/your/fancier/project2 #multiple directories
227
- $ guard -w ~/your/fancy/project # shortcut
224
+ $ bundle exec guard --watchdir ~/your/fancy/project
225
+ $ bundle exec guard -w ~/your/fancy/project ~/your/fancier/project2 #multiple directories
226
+ $ bundle exec guard -w ~/your/fancy/project # shortcut
228
227
  ```
229
228
 
230
229
  #### `-G`/`--guardfile` option
@@ -232,8 +231,8 @@ $ guard -w ~/your/fancy/project # shortcut
232
231
  Guard can use a `Guardfile` not located in the current directory:
233
232
 
234
233
  ```bash
235
- $ guard --guardfile ~/.your_global_guardfile
236
- $ guard -G ~/.your_global_guardfile # shortcut
234
+ $ bundle exec guard --guardfile ~/.your_global_guardfile
235
+ $ bundle exec guard -G ~/.your_global_guardfile # shortcut
237
236
  ```
238
237
 
239
238
  #### `-i`/`--no-interactions` option
@@ -241,8 +240,8 @@ $ guard -G ~/.your_global_guardfile # shortcut
241
240
  Turn off completely any Guard terminal interactions with:
242
241
 
243
242
  ```bash
244
- $ guard start -i
245
- $ guard start --no-interactions
243
+ $ bundle exec guard start -i
244
+ $ bundle exec guard start --no-interactions
246
245
  ```
247
246
 
248
247
  #### `-B`/`--no-bundler-warning` option
@@ -250,8 +249,8 @@ $ guard start --no-interactions
250
249
  Skip Bundler warning when a Gemfile exists in the project directory but Guard is not run with Bundler.
251
250
 
252
251
  ```bash
253
- $ guard start -B
254
- $ guard start --no-bundler-warning
252
+ $ bundle exec guard start -B
253
+ $ bundle exec guard start --no-bundler-warning
255
254
  ```
256
255
 
257
256
  #### `-l`/`--latency` option
@@ -259,8 +258,8 @@ $ guard start --no-bundler-warning
259
258
  Overwrite Listen's default latency, useful when your hard-drive / system is slow.
260
259
 
261
260
  ```bash
262
- $ guard start -l 1.5
263
- $ guard start --latency 1.5
261
+ $ bundle exec guard start -l 1.5
262
+ $ bundle exec guard start --latency 1.5
264
263
  ```
265
264
 
266
265
  #### `-p`/`--force-polling` option
@@ -268,8 +267,8 @@ $ guard start --latency 1.5
268
267
  Force Listen polling listener usage.
269
268
 
270
269
  ```bash
271
- $ guard start -p
272
- $ guard start --force-polling
270
+ $ bundle exec guard start -p
271
+ $ bundle exec guard start --force-polling
273
272
  ```
274
273
 
275
274
  ### List
@@ -277,7 +276,7 @@ $ guard start --force-polling
277
276
  You can list the available plugins with the `list` task:
278
277
 
279
278
  ```bash
280
- $ guard list
279
+ $ bundle exec guard list
281
280
  +----------+--------------+
282
281
  | Plugin | In Guardfile |
283
282
  +----------+--------------+
@@ -296,7 +295,7 @@ $ guard list
296
295
  You can show the structure of the groups and their plugins with the `show` task:
297
296
 
298
297
  ```bash
299
- $ guard show
298
+ $ bundle exec guard show
300
299
  +---------+--------+-----------------+----------------------------+
301
300
  | Group | Plugin | Option | Value |
302
301
  +---------+--------+-----------------+----------------------------+
@@ -320,7 +319,7 @@ read more about these files in the [shared configuration section](https://github
320
319
  You can show the notifiers, their availablity and options with the `notifier` task:
321
320
 
322
321
  ```bash
323
- $ guard notifiers
322
+ $ bundle exec guard notifiers
324
323
  +-------------------+-----------+------+------------------------+-------------------+
325
324
  | Name | Available | Used | Option | Value |
326
325
  +-------------------+-----------+------+------------------------+-------------------+
@@ -444,7 +443,7 @@ detected before sending it to the plugin for processing:
444
443
 
445
444
  ```ruby
446
445
  guard :rspec do
447
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
446
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
448
447
  end
449
448
  ```
450
449
 
@@ -482,7 +481,7 @@ end
482
481
  Groups to be run can be specified with the Guard DSL option `--group` (or `-g`):
483
482
 
484
483
  ```bash
485
- $ guard -g specs
484
+ $ bundle exec guard -g specs
486
485
  ```
487
486
 
488
487
  Guard plugins that don't belong to a group are considered global and are always run.
@@ -697,7 +696,6 @@ Pull requests are very welcome! Please try to follow these simple rules if appli
697
696
  * Make sure your patches are well tested. All specs must pass on [Travis CI](https://travis-ci.org/guard/guard).
698
697
  * Update the [Yard](http://yardoc.org/) documentation.
699
698
  * Update the [README](https://github.com/guard/guard/blob/master/README.md).
700
- * Update the [CHANGELOG](https://github.com/guard/guard/blob/master/CHANGELOG.md) for noteworthy changes (don't forget to run `bundle exec pimpmychangelog` and watch the magic happen)!
701
699
  * Please **do not change** the version number.
702
700
 
703
701
  For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
@@ -720,9 +718,9 @@ Please try to follow these simple rules:
720
718
  #### Core Team
721
719
 
722
720
  * [Michael Kessler](https://github.com/netzpirat) ([@netzpirat](http://twitter.com/netzpirat), [mksoft.ch](https://mksoft.ch))
723
- * [Rémy Coutable](https://github.com/rymai) ([@rymai](http://twitter.com/rymai), [rymai.me](http://rymai.me))
721
+ * [Rémy Coutable](https://github.com/rymai) ([@rymai](http://twitter.com/rymai), [rym.ai](http://rym.ai))
724
722
  * [Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](http://twitter.com/thibaudgg), [thibaud.me](http://thibaud.me/))
725
723
 
726
724
  #### Contributors
727
725
 
728
- [https://github.com/guard/guard/contributors](https://github.com/guard/guard/contributors)
726
+ [https://github.com/guard/guard/graphs/contributors](https://github.com/guard/guard/graphs/contributors)
@@ -27,7 +27,7 @@ module Guard
27
27
  extend Setuper
28
28
 
29
29
  class << self
30
- attr_accessor :interactor, :runner, :listener, :lock, :scope, :running
30
+ attr_accessor :runner, :listener, :lock, :scope, :running
31
31
 
32
32
  # Smart accessor for retrieving specific plugins at once.
33
33
  #
@@ -126,7 +126,7 @@ module Guard
126
126
 
127
127
  _store_terminal_settings if _stty_exists?
128
128
 
129
- if !@thread || !['sleep', 'run'].include?(@thread.status)
129
+ unless @thread
130
130
  ::Guard::UI.debug 'Start interactor'
131
131
 
132
132
  @thread = Thread.new do
@@ -145,6 +145,7 @@ module Guard
145
145
  ::Guard::UI.reset_line
146
146
  ::Guard::UI.debug 'Stop interactor'
147
147
  @thread.kill
148
+ @thread = nil
148
149
  end
149
150
 
150
151
  _restore_terminal_settings if _stty_exists?
@@ -64,21 +64,28 @@ module Guard
64
64
  setup_scope(groups: options.group, plugins: options.plugin)
65
65
 
66
66
  _setup_notifier
67
- _setup_interactor
68
67
 
69
68
  self
70
69
  end
71
70
 
71
+ # Lazy initializer for Guard's options hash
72
+ #
73
+ def options
74
+ @options ||= ::Guard::Options.new(@opts || {}, DEFAULT_OPTIONS)
75
+ end
76
+
72
77
  # Lazy initializer for Guardfile evaluator
73
78
  #
74
79
  def evaluator
75
80
  @evaluator ||= ::Guard::Guardfile::Evaluator.new(@opts || {})
76
81
  end
77
82
 
78
- # Lazy initializer for Guard's options hash
83
+ # Lazy initializer the interactor unless the user has specified not to.
79
84
  #
80
- def options
81
- @options ||= ::Guard::Options.new(@opts || {}, DEFAULT_OPTIONS)
85
+ def interactor
86
+ return if options.no_interactions || !::Guard::Interactor.enabled
87
+
88
+ @interactor ||= ::Guard::Interactor.new
82
89
  end
83
90
 
84
91
  # Clear Guard's options hash
@@ -141,8 +148,9 @@ module Guard
141
148
  private
142
149
 
143
150
  def _reset_lazy_accessors
144
- @options = nil
145
- @evaluator = nil
151
+ @options = nil
152
+ @evaluator = nil
153
+ @interactor = nil
146
154
  end
147
155
 
148
156
  # Sets up various debug behaviors:
@@ -230,14 +238,6 @@ module Guard
230
238
  end
231
239
  end
232
240
 
233
- # Initializes the interactor unless the user has specified not to.
234
- #
235
- def _setup_interactor
236
- unless options.no_interactions || !::Guard::Interactor.enabled
237
- @interactor = ::Guard::Interactor.new
238
- end
239
- end
240
-
241
241
  # Adds a command logger in debug mode. This wraps common command
242
242
  # execution functions and logs the executed command before execution.
243
243
  #
@@ -1,3 +1,3 @@
1
1
  module Guard
2
- VERSION = '2.0.0.pre.3'
2
+ VERSION = '2.0.0.pre.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.3
4
+ version: 2.0.0.pre.4
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: 2013-09-23 00:00:00.000000000 Z
11
+ date: 2013-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.6
19
+ version: 0.18.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.14.6
26
+ version: 0.18.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: listen
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0.beta.2
33
+ version: 2.0.0.pre.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.0.beta.2
40
+ version: 2.0.0.pre.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.9.10
47
+ version: 0.9.12
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.10
54
+ version: 0.9.12
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: lumberjack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.2
61
+ version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.2
68
+ version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: formatador
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 2.14.1
103
+ version: '2.14'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 2.14.1
110
+ version: '2.14'
111
111
  description: Guard is a command line tool to easily handle events on file system modifications.
112
112
  email:
113
113
  - thibaud@thibaud.me