snooper 2.1.4 → 2.1.5

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: 8a753a133e64bb5f5d9644ae6888d05c4afbe5d3
4
- data.tar.gz: 428fedf6ba566276b529797e3e44aee436ce2605
3
+ metadata.gz: 460124dd221c156c48505c20d5a7fe2019177626
4
+ data.tar.gz: 9c4cf277e780feb3f6b44897472ed864976745c2
5
5
  SHA512:
6
- metadata.gz: e90b77c68ee90a3a78e095a4deff3e1631951b83ad14ffe026587c885e9f7f4ef2e36772302b00a5aa69df9c307ddf6fd74c36599a44a4072341414cc785e9a5
7
- data.tar.gz: 80392dd74c9e8de4ea979db07467bb9956d7909fc63d352aa0fbc3801f34a5de58f5b9ecd9c5ea76ad04725fe77ed4b1ce9089e9383cfa056fca3d1d35a08517
6
+ metadata.gz: 96316e289f3ef96311c2069127aa3da5abab27ea5eee7447a42eaded86c7909ad3814e4afb078010edd5802cbe1f3ff05b62920e4829d574d820fb9065ead992
7
+ data.tar.gz: d4f0ac8ff369de89231dad62288e52fd36e3c04d34e4cc6a8d9a166c2b13b25d0c42f83e7d57b093944e4bee3015848969a639c1504e22f55f6d0e241cf92858
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Snooper is a lightweight test automation tool, it monitors files and folders while you work and re-runs your tests when you change something. Snooper doesn't care what language you're using or what framework you are testing with, it's all configureable.
4
4
 
5
- ## Useage
5
+ ## Usage
6
6
 
7
7
  ```bash
8
8
  $ snooper <--config CONFIG | -h> <command>
@@ -27,4 +27,4 @@ _Note_: `filters:` and `ignored:` are regular expressions. This means that
27
27
 
28
28
  ## Licence
29
29
 
30
- Snooper is open source! For more information check out [the licence](LICENCE.md).
30
+ Snooper is open source! For more information check out [the licence](LICENCE.md).
data/bin/snooper CHANGED
@@ -1,7 +1,7 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
3
  # Author:: Will Speak (@willspeak)
4
- # Copyright:: Copyright (c) 2013 Will Speak
4
+ # Copyright:: Copyright (c) 2013, 2014 Will Speak
5
5
  # License:: Snoop is open source! See LICENCE.md for more details.
6
6
 
7
7
  require 'snooper'
@@ -22,13 +22,27 @@ rescue Interrupt
22
22
  puts "Testing over, time for a coffee...".yellow
23
23
  end
24
24
 
25
+ ##
26
+ # Internal: Print out an error AND exit
27
+ #
28
+ # error - The error string to print.
29
+ #
30
+ # returns nothing.
31
+ def fatal_error(error)
32
+ $stderr.puts "#{$0}: error: #{error}"
33
+ exit 1
34
+ end
35
+
25
36
  options = Snooper::Options.parse ARGV
26
37
 
38
+ if options.config_path.nil?
39
+ fatal_error "couldn't find a config file. Did you miss a `--config=`?"
40
+ end
41
+
27
42
  begin
28
43
  config = Snooper::Config.load options.config_path
29
44
  rescue Exception => error
30
- $stdout.puts "#{$0}: error: couldn't load '#{options.config_path}' (#{error})"
31
- exit 1
45
+ fatal_error "couldn't load '#{options.config_path}' (#{error})"
32
46
  end
33
47
 
34
48
  # Override the command if one was specified
@@ -10,5 +10,5 @@ module Snooper
10
10
  #
11
11
  # This should conform to SemVer. If this is changed it should be the only
12
12
  # thing that changes in the comit.
13
- VERSION = '2.1.4'
13
+ VERSION = '2.1.5'
14
14
  end
data/man/snooper-config.7 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "SNOOPER\-CONFIG" "7" "May 2014" "" ""
4
+ .TH "SNOOPER\-CONFIG" "7" "December 2014" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBsnooper\-config\fR \- Configure for Espionage
@@ -13,7 +13,8 @@ Configuration of \fBsnooper\fR is controlled through a YAML file\.
13
13
  snooper(1) expects a YAML document of key\-value pairs; each pair specifies an option\. Unknown options are ignored\. Options that can contain a list of values may also be given a single value\.
14
14
  .
15
15
  .SH "OPTIONS"
16
- String options
16
+ .
17
+ .SS "String options"
17
18
  .
18
19
  .TP
19
20
  \fBbase_path:\fR \fIdirectory\fR
@@ -23,8 +24,7 @@ Specifies the \fIdirectory\fR that \fBsnooper\fR should base all relative paths
23
24
  \fBcommand:\fR \fIcommand_string\fR
24
25
  Specifies the command string to execute when a file change is detected\.
25
26
  .
26
- .P
27
- String Array options
27
+ .SS "String Array options"
28
28
  .
29
29
  .TP
30
30
  \fBpaths:\fR \fIdirectories\fR
@@ -40,39 +40,33 @@ A file change satisfies these filters if the file path matches any of the regula
40
40
  .IP
41
41
  \fINote\fR: as these are regular expressions \fB\e\.c\fR will match both \fBfoo\.c\fR and \fBbar\.cfg\fR, \fB\e\.c$\fR will only match \fB\.c\fR files\.
42
42
  .
43
- .P
44
- Polling
45
- .
46
- .IP "\(bu" 4
47
- \fBforce_poll\fR: \fIpoll\fR Specifies if the polling fallback mode should be used and controls the polling frequency in seconds\. Include this option if you want to use polling but don\'t want to have to specify it on the command line\. Defaults to false\.
43
+ .SS "Polling"
48
44
  .
49
- .IP "" 0
45
+ .TP
46
+ \fBforce_poll:\fR \fIpoll\fR
47
+ Specifies if the polling fallback mode should be used and controls the polling frequency in seconds\. Include this option if you want to use polling but don\'t want to have to specify it on the command line\. Defaults to false\.
50
48
  .
51
- .P
49
+ .IP
52
50
  This mode can be slower and more buggy but is useful for working around bugs in third party applications that hide filesystem events\. Known to be required when you are snooping on VirtualBox shared folders, or in Dropbox folders\.
53
51
  .
54
- .P
52
+ .IP
55
53
  \fINote\fR: This option can be overridden from the command line with the \fB\-\-poll\fR option\.
56
54
  .
57
- .P
58
- Hooks
59
- .
60
- .P
55
+ .SS "Hooks"
61
56
  Hooks are useful to pefrom special commads upon a subset of the file\-change events\. Each hook is run a single time if any of the filepaths that satisfy \fBfilters:\fR and \fBignored:\fR aslo match the \fBpattern:\fR of the filter\.
62
57
  .
63
- .IP "\(bu" 4
64
- \fBhooks:\fR \fIhook_list\fR Specifies a list of hooks, where each hook represents a task that should be carried out upon a subset of the triggering events\. The hooks key should contain a list of mappings\. Each mappign should have the two following keys:
65
- .
66
- .IP "\(bu" 4
67
- \fBpattern:\fR \fIregexp\fR The pattern to run the hook on\. This should be of the same format as \fBfilters:\fR and \fBignored:\fR\. Note that hooks can only match a subset of all file changes as controlled by \fBfilters:\fR and \fBignored:\fR\.
58
+ .TP
59
+ \fBhooks:\fR \fIhook_list\fR
60
+ Specifies a list of hooks, where each hook represents a task that should be carried out upon a subset of the triggering events\. The hooks key should contain a list of mappings\. Each mappign should have the two following keys:
68
61
  .
69
- .IP "\(bu" 4
70
- \fBcommand:\fR \fIcommand_string\fR A command to be run when the hook is triggered\. This is of the same format as the global \fBcommand:\fR key\.
62
+ .TP
63
+ \fBpattern:\fR \fIregexp\fR
64
+ The pattern to run the hook on\. This should be of the same format as \fBfilters:\fR and \fBignored:\fR\. Note that hooks can only match a subset of all file changes as controlled by \fBfilters:\fR and \fBignored:\fR\.
71
65
  .
72
- .IP "" 0
66
+ .TP
67
+ \fBcommand:\fR \fIcommand_string\fR
68
+ A command to be run when the hook is triggered\. This is of the same format as the global \fBcommand:\fR key\.
73
69
 
74
- .
75
- .IP "" 0
76
70
  .
77
71
  .SH "SEE ALSO"
78
72
  snooper(1)
@@ -101,7 +101,7 @@ may also be given a single value.</p>
101
101
 
102
102
  <h2 id="OPTIONS">OPTIONS</h2>
103
103
 
104
- <p>String options</p>
104
+ <h3 id="String-options">String options</h3>
105
105
 
106
106
  <dl>
107
107
  <dt><code>base_path:</code> <var>directory</var></dt><dd><p>Specifies the <var>directory</var> that <code>snooper</code> should base all relative paths from.
@@ -110,7 +110,7 @@ This is also the working directory that commands and hooks will inherit.</p></dd
110
110
  </dl>
111
111
 
112
112
 
113
- <p>String Array options</p>
113
+ <h3 id="String-Array-options">String Array options</h3>
114
114
 
115
115
  <dl>
116
116
  <dt><code>paths:</code> <var>directories</var></dt><dd><p>Specifies a list of <var>directories</var> to watch. Directories can be either
@@ -129,41 +129,37 @@ regular expressions in <code>filters</code> and none of those in <code>ignored</
129
129
  </dl>
130
130
 
131
131
 
132
- <p>Polling</p>
132
+ <h3 id="Polling">Polling</h3>
133
133
 
134
- <ul>
135
- <li><code>force_poll</code>: <var>poll</var>
136
- Specifies if the polling fallback mode should be used and controls the polling frequency in seconds. Include this option if you want to use polling but don't want to have to specify it on the command line. Defaults to false.</li>
137
- </ul>
134
+ <dl>
135
+ <dt><code>force_poll:</code> <var>poll</var></dt><dd><p> Specifies if the polling fallback mode should be used and controls the polling frequency in seconds. Include this option if you want to use polling but don't want to have to specify it on the command line. Defaults to false.</p>
138
136
 
137
+ <p>This mode can be slower and more buggy but is useful for working around bugs in third party applications that hide filesystem events. Known to be required when you are snooping on VirtualBox shared folders, or in Dropbox folders.</p>
139
138
 
140
- <p> This mode can be slower and more buggy but is useful for working around bugs in third party applications that hide filesystem events. Known to be required when you are snooping on VirtualBox shared folders, or in Dropbox folders.</p>
139
+ <p><em>Note</em>: This option can be overridden from the command line with the <code>--poll</code> option.</p></dd>
140
+ </dl>
141
141
 
142
- <p><em>Note</em>: This option can be overridden from the command line with the <code>--poll</code> option.</p>
143
142
 
144
- <p>Hooks</p>
143
+ <h3 id="Hooks">Hooks</h3>
145
144
 
146
145
  <p>Hooks are useful to pefrom special commads upon a subset of the file-change
147
146
  events. Each hook is run a single time if any of the filepaths that satisfy
148
147
  <code>filters:</code> and <code>ignored:</code> aslo match the <code>pattern:</code> of the filter.</p>
149
148
 
150
- <ul>
151
- <li><p><code>hooks:</code> <var>hook_list</var>
152
- Specifies a list of hooks, where each hook represents a task that should
153
- be carried out upon a subset of the triggering events. The hooks key should
154
- contain a list of mappings. Each mappign should have the two following keys:</p>
149
+ <dl>
150
+ <dt><code>hooks:</code> <var>hook_list</var></dt><dd><p>Specifies a list of hooks, where each hook represents a task that should
151
+ be carried out upon a subset of the triggering events. The hooks key should
152
+ contain a list of mappings. Each mappign should have the two following keys:</p>
155
153
 
156
- <ul>
157
- <li><p><code>pattern:</code> <var>regexp</var>
158
- The pattern to run the hook on. This should be of the same format as
154
+ <dl>
155
+ <dt><code>pattern:</code> <var>regexp</var></dt><dd><p>The pattern to run the hook on. This should be of the same format as
159
156
  <code>filters:</code> and <code>ignored:</code>. Note that hooks can only match a subset of all
160
- file changes as controlled by <code>filters:</code> and <code>ignored:</code>.</p></li>
161
- <li><p><code>command:</code> <var>command_string</var>
162
- A command to be run when the hook is triggered. This is of the same format
163
- as the global <code>command:</code> key.</p></li>
164
- </ul>
165
- </li>
166
- </ul>
157
+ file changes as controlled by <code>filters:</code> and <code>ignored:</code>.</p></dd>
158
+ <dt><code>command:</code> <var>command_string</var></dt><dd><p>A command to be run when the hook is triggered. This is of the same format
159
+ as the global <code>command:</code> key.</p></dd>
160
+ </dl>
161
+ </dd>
162
+ </dl>
167
163
 
168
164
 
169
165
  <h2 id="SEE-ALSO">SEE ALSO</h2>
@@ -177,7 +173,7 @@ as the global <code>command:</code> key.</p></li>
177
173
 
178
174
  <ol class='man-decor man-foot man foot'>
179
175
  <li class='tl'></li>
180
- <li class='tc'>May 2014</li>
176
+ <li class='tc'>December 2014</li>
181
177
  <li class='tr'>snooper-config(7)</li>
182
178
  </ol>
183
179
 
@@ -13,7 +13,7 @@ may also be given a single value.
13
13
 
14
14
  ## OPTIONS
15
15
 
16
- String options
16
+ ### String options
17
17
 
18
18
  * `base_path:` <directory>:
19
19
  Specifies the <directory> that `snooper` should base all relative paths from.
@@ -22,7 +22,7 @@ String options
22
22
  * `command:` <command_string>:
23
23
  Specifies the command string to execute when a file change is detected.
24
24
 
25
- String Array options
25
+ ### String Array options
26
26
 
27
27
  * `paths:` <directories>:
28
28
  Specifies a list of <directories> to watch. Directories can be either
@@ -41,34 +41,34 @@ String Array options
41
41
  _Note_: as these are regular expressions `\.c` will match both
42
42
  `foo.c` and `bar.cfg`, `\.c$` will only match `.c` files.
43
43
 
44
- Polling
44
+ ### Polling
45
45
 
46
- * `force_poll`: <poll>
47
- Specifies if the polling fallback mode should be used and controls the polling frequency in seconds. Include this option if you want to use polling but don't want to have to specify it on the command line. Defaults to false.
48
-
49
- This mode can be slower and more buggy but is useful for working around bugs in third party applications that hide filesystem events. Known to be required when you are snooping on VirtualBox shared folders, or in Dropbox folders.
50
-
51
- _Note_: This option can be overridden from the command line with the `--poll` option.
46
+ * `force_poll:` <poll>:
47
+ Specifies if the polling fallback mode should be used and controls the polling frequency in seconds. Include this option if you want to use polling but don't want to have to specify it on the command line. Defaults to false.
48
+
49
+ This mode can be slower and more buggy but is useful for working around bugs in third party applications that hide filesystem events. Known to be required when you are snooping on VirtualBox shared folders, or in Dropbox folders.
50
+
51
+ _Note_: This option can be overridden from the command line with the `--poll` option.
52
52
 
53
- Hooks
53
+ ### Hooks
54
54
 
55
55
  Hooks are useful to pefrom special commads upon a subset of the file-change
56
56
  events. Each hook is run a single time if any of the filepaths that satisfy
57
57
  `filters:` and `ignored:` aslo match the `pattern:` of the filter.
58
+
59
+ * `hooks:` <hook_list>:
60
+ Specifies a list of hooks, where each hook represents a task that should
61
+ be carried out upon a subset of the triggering events. The hooks key should
62
+ contain a list of mappings. Each mappign should have the two following keys:
63
+
64
+ * `pattern:` <regexp>:
65
+ The pattern to run the hook on. This should be of the same format as
66
+ `filters:` and `ignored:`. Note that hooks can only match a subset of all
67
+ file changes as controlled by `filters:` and `ignored:`.
58
68
 
59
- * `hooks:` <hook_list>
60
- Specifies a list of hooks, where each hook represents a task that should
61
- be carried out upon a subset of the triggering events. The hooks key should
62
- contain a list of mappings. Each mappign should have the two following keys:
63
-
64
- * `pattern:` <regexp>
65
- The pattern to run the hook on. This should be of the same format as
66
- `filters:` and `ignored:`. Note that hooks can only match a subset of all
67
- file changes as controlled by `filters:` and `ignored:`.
68
-
69
- * `command:` <command_string>
70
- A command to be run when the hook is triggered. This is of the same format
71
- as the global `command:` key.
69
+ * `command:` <command_string>:
70
+ A command to be run when the hook is triggered. This is of the same format
71
+ as the global `command:` key.
72
72
 
73
73
  ## SEE ALSO
74
74
 
data/man/snooper.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "SNOOPER" "1" "May 2014" "" ""
4
+ .TH "SNOOPER" "1" "December 2014" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBsnooper\fR \- Spy on Tests
data/man/snooper.1.html CHANGED
@@ -145,7 +145,7 @@ when files change.</p>
145
145
 
146
146
  <ol class='man-decor man-foot man foot'>
147
147
  <li class='tl'></li>
148
- <li class='tc'>May 2014</li>
148
+ <li class='tc'>December 2014</li>
149
149
  <li class='tr'>snooper(1)</li>
150
150
  </ol>
151
151
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snooper
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Speak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -112,9 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.0.6
115
+ rubygems_version: 2.0.14
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Spying on Tests
119
119
  test_files: []
120
- has_rdoc: