snooper 0.0.1 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b17047b1a8079dcfab7eb6a6360e5ebf4464354
4
- data.tar.gz: 6b726f039518b7e0e5b4f9170ed2d3c18f126b96
3
+ metadata.gz: 2c770ca85f973ece6ee0dafd2525fa4a1ab9a847
4
+ data.tar.gz: 809646762899f32c4f57e596be6d0c7b2eefe164
5
5
  SHA512:
6
- metadata.gz: c34d1cd520480339978ad9c737a9a5d10bbe38b3370778c075e282b8ac2bbd53d4757827de83bc74d511c3dc50868b5a8a86c767cb8263c31bc142a1d31486c8
7
- data.tar.gz: 9b3e531d6238fa0a57400aebf5cee5eb0082cb1df6a03c07accd06a4ea859a4afa3148ef126909644211f88e778a7ec0c3a151b85511c08b671bc6515f81c43c
6
+ metadata.gz: 095a8c271de8100250a1346c1aca5fb41d660e6fdd9850fbc68d6f20063d9071c8def7a8feee4aea6266d41a3d8986227fcb12c42f2763b8a9d8ae9774323280
7
+ data.tar.gz: 0b09d92b6e88dd3324a20e3e035b524e2c24a92046f5cf73b2605ed3bae75b675195ad085a3b4cceafbf48c97489ed15189df457d6f973a0689b85d87041f1f5
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ #Snooper
2
+
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
+
5
+ ##Useage
6
+
7
+ ```bash
8
+ $ snooper <directory> <command>
9
+ ```
10
+
11
+ See [snooper(1)](http://iwillspeak.github.com/snooper/snooper.1.html) for more information.
12
+
13
+ ##Licence
14
+
15
+ Snooper is open source! For more information check out [the licence](LICENCE.md).
data/bin/snooper CHANGED
@@ -1,26 +1,126 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
+ # Author:: Will Speak (@willspeak)
4
+ # Copyright:: Copyright (c) 2013 Will Speak
5
+ # License:: Snoop is open source! See LICENCE.md for more details.
6
+
3
7
  require 'snooper'
4
8
  require 'colored'
9
+ require 'optparse'
10
+ require 'yaml'
11
+
12
+ ##
13
+ # Main program loop
14
+ #
15
+ # Do our stuff, and exit cleanly when interrupted.
5
16
 
6
17
  def test_loop(options)
7
18
  begin
8
- dirs = options[:dirs] ? options[:dirs] : './'
19
+ dirs = options[:paths].empty? ? './' : options[:paths]
9
20
  Snooper.watch dirs, options
10
21
  rescue Interrupt
11
22
  puts # This is where the ^C is on unix
12
- puts "Done".yellow
23
+ puts "Testing over, time for a coffee...".yellow
13
24
  end
14
25
  end
15
26
 
16
- # TODO: load the options from the arguments
17
- options = {
18
- :base_dir => ARGV.shift,
19
- :command => (ARGV.shift or "echo 'no tests to run :-)'"),
20
- :filters => %w{\.c \.h \.mk},
21
- :exclude => %w{build/ bin/}
22
- }
27
+ ##
28
+ # Parse the command line and load the options
29
+ #
30
+
31
+ def get_options
32
+
33
+ helptext = <<END
34
+
35
+ Snooper is a lightweight test automation tool, it monitors files and folders
36
+ while you work and re-runs your tests when you change something. Snooper
37
+ doesn't care what language you're using or what framework you are testing with,
38
+ it's all configureable.
39
+
40
+ For more information see snooper(1).
41
+ END
42
+
43
+ config_path = '.snooper.yaml'
44
+ opts = OptionParser.new do |opts|
45
+ opts.banner =
46
+ "Useage: #{File.basename __FILE__} [--config <CONFIG> | --help] " +
47
+ "[<COMMAND>]*"
48
+
49
+ opts.separator helptext
50
+
51
+ opts.on '-c', '--config CONFIGFILE', 'YAML configuration file' do |path|
52
+ config_path = path
53
+ end
54
+
55
+ opts.on("-h", "--help", "Show this message") do
56
+ puts opts
57
+ exit
58
+ end
59
+ end
60
+
61
+ # Parse the options
62
+ begin
63
+ opts.parse!
64
+ rescue OptionParser::InvalidOption, \
65
+ OptionParser::MissingArgument, \
66
+ OptionParser::InvalidArgument => e
67
+ puts e
68
+ puts opts
69
+ exit 1
70
+ end
71
+
72
+ # Load the config file
73
+ begin
74
+ yamopts = YAML.load_file config_path
75
+ rescue Exception => e
76
+ puts "Error loading the config: #{e}"
77
+ exit 1
78
+ end
79
+
80
+ if not yamopts.is_a? Hash
81
+ puts "Invalid options file"
82
+ exit 1
83
+ end
84
+
85
+ # default options
86
+ options = {
87
+ :base_path => nil,
88
+ :command => nil,
89
+ :filters => [],
90
+ :ignored => [],
91
+ :paths => []
92
+ }
93
+
94
+ yamopts.each do |option, argument|
95
+ case option
96
+ when 'base_path', 'command'
97
+ options[option.to_sym] = argument.to_s
98
+
99
+ when 'paths', 'filters', 'ignored'
100
+ argument = argument.split if argument.is_a? String
101
+ options[option.to_sym] += Array(argument)
102
+
103
+ else
104
+ puts "Ignoring unknown option #{option}".red
105
+ end
106
+ end
107
+
108
+ if options[:base_path]
109
+ base = File.expand_path options[:base_path], File.dirname(config_path)
110
+ options[:paths].map! { |p| File.expand_path p, base }
111
+ options[:base_path] = base
112
+ end
113
+
114
+ # Override the command if one was specified
115
+ options[:command] = ARGV.join " " if not ARGV.empty?
116
+
117
+ options
118
+ end
23
119
 
24
- Dir.chdir options[:base_dir] if options[:base_dir]
120
+ options = get_options
25
121
 
122
+ # Run the tests, pusing the target directory
123
+ old_dir = File.expand_path '.'
124
+ Dir.chdir options[:base_path] if options[:base_path]
26
125
  test_loop options
126
+ Dir.chdir old_dir
data/lib/snooper/snoop.rb CHANGED
@@ -1,21 +1,46 @@
1
+ # Author:: Will Speak (@willspeak)
2
+ # Copyright:: Copyright (c) 2013 Will Speak
3
+ # License:: Snoop is open source! See LICENCE.md for more details.
4
+
1
5
  module Snooper
6
+
7
+ ##
8
+ # Watches over a directory, executing a comand when files change
9
+ #
10
+ # The fine-grained behaviour of this class is controlled by the parameters
11
+ # passed to the +new+ method.
2
12
  class Snoop
3
13
 
4
14
  require 'listen'
5
15
  require 'colored'
6
16
  require 'terminfo'
7
17
 
18
+ ##
19
+ # Create a new source code spy
20
+ #
21
+ # @param [String, Array] path - the path (or paths) to begin watching
22
+ # @param [Hash] args - the options hash
23
+ # [+:filters+] [Array,String,Regexp] Files to include, empty for all
24
+ # [+:ignored+] [Array,String,Regexp] Paths to ignore
25
+ # [+:command+] [String] The command to run when changes are detected
26
+
8
27
  def initialize(path, args = {})
9
28
  to_regex = Proc.new { |r| Regexp.new r if not r.is_a?(Regexp) }
10
29
 
11
30
  @paths = Array(path)
12
31
  @filters = args[:filters]
13
- @filters = Array(args[:filters]).map(&to_regex) if @filters
32
+ @filters = Array(@filters).map(&to_regex) if @filters
14
33
  @ignored = args[:ignored]
15
- @ignored = Array(args[:exclude]).map(&to_regex) if @ignored
34
+ @ignored = Array(@ignored).map(&to_regex) if @ignored
16
35
  @command = args[:command]
17
36
  end
18
37
 
38
+ ##
39
+ # Change callback
40
+ #
41
+ # Called when a filesystem change is detected by +listen+. Runs the command
42
+ # passed to t he constructor and prints a summary of the output.
43
+
19
44
  def on_change(modified, added, removed)
20
45
  begin
21
46
  # Puase the listener to make sure any build output doesn't mess with things
@@ -23,15 +48,17 @@ module Snooper
23
48
 
24
49
  # summarise the changes made
25
50
  changes = modified + added + removed
26
-
27
- puts
28
- puts "#{changes.length.to_s.magenta.bold} changes, retesting..."
51
+
52
+ statusline = ('-' * removed.length).red
53
+ statusline << ('.' * modified.length).blue
54
+ statusline << ('+' * added.length).green
55
+ puts "#{statusline} #{changes.length.to_s.magenta.bold} changes"
29
56
 
30
57
  # run the test suite and check the result
31
58
  if system @command then
32
59
  puts statusbar "All tests passed", &:white_on_green
33
60
  else
34
- puts self.statusbar "Tests failed", &:white_on_red
61
+ puts statusbar "Tests failed", &:white_on_red
35
62
  end
36
63
 
37
64
  # return to listening
@@ -42,15 +69,31 @@ module Snooper
42
69
  end
43
70
  end
44
71
 
72
+ ##
73
+ # Prettify a status line
74
+ #
75
+ # Prints the message at the center of the line, automatically detected
76
+ # from the terminal info. If a block is supplied then the resulting message
77
+ # is post-filtered by it before being returned.
78
+ #
79
+ # @param message - the message to print
80
+
45
81
  def statusbar(message)
46
82
  message = message.to_s.center TermInfo.screen_width
47
83
  block_given? ? yield(message) : message
48
84
  end
49
-
85
+
86
+ ##
87
+ # Main run loop
88
+ #
89
+ # Registers for filesystem notifications and dispatches them to the
90
+ # +on_change+ handler. This method also forces a dummy update to ensure that
91
+ # tests are run when watching begins.
92
+
50
93
  def run
51
94
 
52
95
  # Force a change to start with
53
- self.on_change [], [], []
96
+ on_change [], [], []
54
97
 
55
98
  callback_helper = Proc.new {|*args| self.on_change *args }
56
99
 
data/lib/snooper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ ##
1
2
  # This program runs in the background watching for file changes. When a file
2
3
  # change is dtected a command is run. It is intended to watch repos for changes
3
4
  # and run unit tests automatically when source files are changed.
@@ -6,11 +7,18 @@
6
7
  # Copyright:: Copyright (c) 2013 Will Speak
7
8
  # License:: Snoop is open source! See LICENCE.md for more details.
8
9
 
9
- #
10
+ # This module provides the snooping abilities.
11
+ #
12
+ # For most applications calling the +Snooper#watch+ method should be sufficient
13
+ # if Snooper::Snoop objects can be created directly.
10
14
  module Snooper
11
15
 
12
16
  require 'snooper/snoop'
13
17
 
18
+ ##
19
+ # Watch for changes in a directory
20
+ #
21
+ # @param args - see Snooper::Snoop.new for more information
14
22
  def self.watch(*args)
15
23
  george = Snoop.new *args
16
24
  george.run
@@ -0,0 +1,41 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "SNOOPER\-CONFIG" "7" "March 2013" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBsnooper\-config\fR \- Configure for Espionage
8
+ .
9
+ .SH "DESCRIPTION"
10
+ Configuration of \fBsnooper\fR is controlled through a YAML file\.
11
+ .
12
+ .SH "FORMAT"
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
+ .
15
+ .SH "OPTIONS"
16
+ String options
17
+ .
18
+ .TP
19
+ \fBbase_path:\fR \fIdirectory\fR
20
+ Specifies the \fIdirectory\fR that \fBsnooper\fR should base all relative paths from\. This is also the working directory that commands will inherit\.
21
+ .
22
+ .TP
23
+ \fBcommand:\fR \fIcommand_string\fR
24
+ Specifies the command string to execute when a file change is detected\.
25
+ .
26
+ .P
27
+ String Array options
28
+ .
29
+ .TP
30
+ \fBpaths:\fR \fIdirectories\fR
31
+ Specifies a list of \fIdirectories\fR to watch\. Directories can be either relative or absolute paths\. If no paths are specified the default is to watch \fBbase_path\fR\.
32
+ .
33
+ .TP
34
+ \fBfilters:\fR \fIfilters\fR, \fBignored:\fR \fIfilters\fR
35
+ Specifies a list of regular expressions \fIfilters\fR to use to filter the changes\. These should be in a format understood by ruby(1)\'s Regex\.new method\. If none are given then all changes in watched directories trigger testing\.
36
+ .
37
+ .IP
38
+ \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\.
39
+ .
40
+ .SH "SEE ALSO"
41
+ snooper(1)
@@ -0,0 +1,141 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>snooper-config(7) - Configure for Espionage</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ <style type='text/css' media='all'>
45
+ /* style: dark */
46
+ .mp,body#manpage {background:#080706;color:#888}
47
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#aaa}
48
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#fff}
49
+ .man-decor,.man-decor ol li {color:#666}
50
+ .mp code,.mp strong,.mp b {color:#fff}
51
+ .mp em,.mp var,.mp u {color:#ddd}
52
+ .mp pre code {color:#ddd}
53
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#fff}
54
+ </style>
55
+ <style type='text/css' media='all'>
56
+ /* style: toc */
57
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
58
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
59
+ .man-navigation a:hover {color:#111;text-decoration:underline}
60
+ </style>
61
+ </head>
62
+ <!--
63
+ The following styles are deprecated and will be removed at some point:
64
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
65
+
66
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
67
+ .man-navigation should be used instead.
68
+ -->
69
+ <body id='manpage'>
70
+ <div class='mp' id='man'>
71
+
72
+ <div class='man-navigation' style='display:none'>
73
+ <a href="#NAME">NAME</a>
74
+ <a href="#DESCRIPTION">DESCRIPTION</a>
75
+ <a href="#FORMAT">FORMAT</a>
76
+ <a href="#OPTIONS">OPTIONS</a>
77
+ <a href="#SEE-ALSO">SEE ALSO</a>
78
+ </div>
79
+
80
+ <ol class='man-decor man-head man head'>
81
+ <li class='tl'>snooper-config(7)</li>
82
+ <li class='tc'></li>
83
+ <li class='tr'>snooper-config(7)</li>
84
+ </ol>
85
+
86
+ <h2 id="NAME">NAME</h2>
87
+ <p class="man-name">
88
+ <code>snooper-config</code> - <span class="man-whatis">Configure for Espionage</span>
89
+ </p>
90
+
91
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
92
+
93
+ <p>Configuration of <code>snooper</code> is controlled through a YAML file.</p>
94
+
95
+ <h2 id="FORMAT">FORMAT</h2>
96
+
97
+ <p><a class="man-ref" href="snooper.1.html">snooper<span class="s">(1)</span></a> expects a YAML document of key-value pairs; each pair specifies an
98
+ option. Unknown options are ignored. Options that can contain a list of values
99
+ may also be given a single value.</p>
100
+
101
+ <h2 id="OPTIONS">OPTIONS</h2>
102
+
103
+ <p>String options</p>
104
+
105
+ <dl>
106
+ <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.
107
+ This is also the working directory that commands will inherit.</p></dd>
108
+ <dt><code>command:</code> <var>command_string</var></dt><dd><p>Specifies the command string to execute when a file change is detected.</p></dd>
109
+ </dl>
110
+
111
+
112
+ <p>String Array options</p>
113
+
114
+ <dl>
115
+ <dt><code>paths:</code> <var>directories</var></dt><dd><p>Specifies a list of <var>directories</var> to watch. Directories can be either
116
+ relative or absolute paths. If no paths are specified the default is to
117
+ watch <code>base_path</code>.</p></dd>
118
+ <dt><code>filters:</code> <var>filters</var>, <code>ignored:</code> <var>filters</var></dt><dd><p>Specifies a list of regular expressions <var>filters</var> to use to filter the
119
+ changes. These should be in a format understood by <span class="man-ref">ruby<span class="s">(1)</span></span>'s Regex.new
120
+ method. If none are given then all changes in watched directories trigger
121
+ testing.</p>
122
+
123
+ <p><em>Note</em>: as these are regular expressions <code>\.c</code> will match both
124
+ <code>foo.c</code> and <code>bar.cfg</code>, <code>\.c$</code> will only match <code>.c</code> files.</p></dd>
125
+ </dl>
126
+
127
+
128
+ <h2 id="SEE-ALSO">SEE ALSO</h2>
129
+
130
+ <p><a class="man-ref" href="snooper.1.html">snooper<span class="s">(1)</span></a></p>
131
+
132
+
133
+ <ol class='man-decor man-foot man foot'>
134
+ <li class='tl'></li>
135
+ <li class='tc'>March 2013</li>
136
+ <li class='tr'>snooper-config(7)</li>
137
+ </ol>
138
+
139
+ </div>
140
+ </body>
141
+ </html>
@@ -0,0 +1,43 @@
1
+ snooper-config(7) - Configure for Espionage
2
+ ===========================================
3
+
4
+ ## DESCRIPTION
5
+
6
+ Configuration of `snooper` is controlled through a YAML file.
7
+
8
+ ## FORMAT
9
+
10
+ snooper(1) expects a YAML document of key-value pairs; each pair specifies an
11
+ option. Unknown options are ignored. Options that can contain a list of values
12
+ may also be given a single value.
13
+
14
+ ## OPTIONS
15
+
16
+ String options
17
+
18
+ * `base_path:` <directory>:
19
+ Specifies the <directory> that `snooper` should base all relative paths from.
20
+ This is also the working directory that commands will inherit.
21
+
22
+ * `command:` <command_string>:
23
+ Specifies the command string to execute when a file change is detected.
24
+
25
+ String Array options
26
+
27
+ * `paths:` <directories>:
28
+ Specifies a list of <directories> to watch. Directories can be either
29
+ relative or absolute paths. If no paths are specified the default is to
30
+ watch `base_path`.
31
+
32
+ * `filters:` <filters>, `ignored:` <filters>:
33
+ Specifies a list of regular expressions <filters> to use to filter the
34
+ changes. These should be in a format understood by ruby(1)'s Regex.new
35
+ method. If none are given then all changes in watched directories trigger
36
+ testing.
37
+
38
+ _Note_: as these are regular expressions `\.c` will match both
39
+ `foo.c` and `bar.cfg`, `\.c$` will only match `.c` files.
40
+
41
+ ## SEE ALSO
42
+
43
+ snooper(1)
data/man/snooper.1 ADDED
@@ -0,0 +1,42 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "SNOOPER" "1" "March 2013" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBsnooper\fR \- Spy on Tests
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBsnooper\fR \fIoptions\fR [\fIcommand_line\fR]*
11
+ .
12
+ .SH "DESCRIPTION"
13
+ \fBSnooper\fR 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\.
14
+ .
15
+ .SH "OPTIONS"
16
+ Most configuration takes place in the snooper\-config(7) file\. You can however override the command that is run\. This is useful if you are only working on a subsection of a project that has it\'s own tests\.
17
+ .
18
+ .TP
19
+ \fB\-c\fR, \fB\-\-config\fR \fIconfigfile\fR
20
+ Specify the configuration file to use\. The default is \fB\.snooper\.yaml\fR in the current directory\.
21
+ .
22
+ .TP
23
+ \fIcommand_line\fR
24
+ One or more \fIcommand_line\fRs to execute when source files change\. Overides any commands specified in the configuration file\.
25
+ .
26
+ .SH "EXAMPLES"
27
+ \fB$ snooper\fR
28
+ .
29
+ .P
30
+ To run snooper in the current directory, configured by the \fB\.snooper\.yaml\fR file\.
31
+ .
32
+ .P
33
+ \fB$ snooper \-\-config snooperrc "echo Hello World!"\fR
34
+ .
35
+ .P
36
+ To snooper using the cofiguration in \fIsnooperrc\fR executing \fBecho Hello World!\fR when files change\.
37
+ .
38
+ .SH "BUGS"
39
+ \fBSnooper\fR does not yet load the configuration file\.
40
+ .
41
+ .SH "AUTHORS"
42
+ Will Speak (@willspeak)
@@ -0,0 +1,146 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>snooper(1) - Spy on Tests</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ <style type='text/css' media='all'>
45
+ /* style: dark */
46
+ .mp,body#manpage {background:#080706;color:#888}
47
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#aaa}
48
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#fff}
49
+ .man-decor,.man-decor ol li {color:#666}
50
+ .mp code,.mp strong,.mp b {color:#fff}
51
+ .mp em,.mp var,.mp u {color:#ddd}
52
+ .mp pre code {color:#ddd}
53
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#fff}
54
+ </style>
55
+ <style type='text/css' media='all'>
56
+ /* style: toc */
57
+ .man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
58
+ .man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
59
+ .man-navigation a:hover {color:#111;text-decoration:underline}
60
+ </style>
61
+ </head>
62
+ <!--
63
+ The following styles are deprecated and will be removed at some point:
64
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
65
+
66
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
67
+ .man-navigation should be used instead.
68
+ -->
69
+ <body id='manpage'>
70
+ <div class='mp' id='man'>
71
+
72
+ <div class='man-navigation' style='display:none'>
73
+ <a href="#NAME">NAME</a>
74
+ <a href="#SYNOPSIS">SYNOPSIS</a>
75
+ <a href="#DESCRIPTION">DESCRIPTION</a>
76
+ <a href="#OPTIONS">OPTIONS</a>
77
+ <a href="#EXAMPLES">EXAMPLES</a>
78
+ <a href="#BUGS">BUGS</a>
79
+ <a href="#AUTHORS">AUTHORS</a>
80
+ </div>
81
+
82
+ <ol class='man-decor man-head man head'>
83
+ <li class='tl'>snooper(1)</li>
84
+ <li class='tc'></li>
85
+ <li class='tr'>snooper(1)</li>
86
+ </ol>
87
+
88
+ <h2 id="NAME">NAME</h2>
89
+ <p class="man-name">
90
+ <code>snooper</code> - <span class="man-whatis">Spy on Tests</span>
91
+ </p>
92
+
93
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
94
+
95
+ <p><code>snooper</code> <var>options</var> [<var>command_line</var>]*</p>
96
+
97
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
98
+
99
+ <p><strong>Snooper</strong> is a lightweight test automation tool, it monitors files and
100
+ folders while you work and re-runs your tests when you change something.
101
+ Snooper doesn't care what language you're using or what framework you are
102
+ testing with, it's all configureable.</p>
103
+
104
+ <h2 id="OPTIONS">OPTIONS</h2>
105
+
106
+ <p>Most configuration takes place in the <a class="man-ref" href="snooper-config.7.html">snooper-config<span class="s">(7)</span></a> file. You can however
107
+ override the command that is run. This is useful if you are only working on a
108
+ subsection of a project that has it's own tests.</p>
109
+
110
+ <dl>
111
+ <dt><code>-c</code>, <code>--config</code> <var>configfile</var></dt><dd><p>Specify the configuration file to use. The default is <code>.snooper.yaml</code> in the
112
+ current directory.</p></dd>
113
+ <dt><var>command_line</var></dt><dd><p>One or more <var>command_line</var>s to execute when source files change. Overides any
114
+ commands specified in the configuration file.</p></dd>
115
+ </dl>
116
+
117
+
118
+ <h2 id="EXAMPLES">EXAMPLES</h2>
119
+
120
+ <p><code>$ snooper</code></p>
121
+
122
+ <p>To run snooper in the current directory, configured by the <code>.snooper.yaml</code> file.</p>
123
+
124
+ <p><code>$ snooper --config snooperrc "echo Hello World!"</code></p>
125
+
126
+ <p>To snooper using the cofiguration in <var>snooperrc</var> executing <code>echo Hello World!</code>
127
+ when files change.</p>
128
+
129
+ <h2 id="BUGS">BUGS</h2>
130
+
131
+ <p><strong>Snooper</strong> does not yet load the configuration file.</p>
132
+
133
+ <h2 id="AUTHORS">AUTHORS</h2>
134
+
135
+ <p>Will Speak (@willspeak)</p>
136
+
137
+
138
+ <ol class='man-decor man-foot man foot'>
139
+ <li class='tl'></li>
140
+ <li class='tc'>March 2013</li>
141
+ <li class='tr'>snooper(1)</li>
142
+ </ol>
143
+
144
+ </div>
145
+ </body>
146
+ </html>
@@ -0,0 +1,47 @@
1
+ snooper(1) -- Spy on Tests
2
+ ==========================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `snooper` <options> [<command_line>]*
7
+
8
+ ## DESCRIPTION
9
+
10
+ **Snooper** is a lightweight test automation tool, it monitors files and
11
+ folders while you work and re-runs your tests when you change something.
12
+ Snooper doesn't care what language you're using or what framework you are
13
+ testing with, it's all configureable.
14
+
15
+ ## OPTIONS
16
+
17
+ Most configuration takes place in the snooper-config(7) file. You can however
18
+ override the command that is run. This is useful if you are only working on a
19
+ subsection of a project that has it's own tests.
20
+
21
+ * `-c`, `--config` <configfile>:
22
+ Specify the configuration file to use. The default is `.snooper.yaml` in the
23
+ current directory.
24
+
25
+ * <command_line>:
26
+ One or more <command_line>s to execute when source files change. Overides any
27
+ commands specified in the configuration file.
28
+
29
+ ## EXAMPLES
30
+
31
+ `$ snooper`
32
+
33
+ To run snooper in the current directory, configured by the `.snooper.yaml` file.
34
+
35
+ `$ snooper --config snooperrc "echo Hello World!"`
36
+
37
+ To snooper using the cofiguration in <snooperrc> executing `echo Hello World!`
38
+ when files change.
39
+
40
+ ## BUGS
41
+
42
+ **Snooper** does not yet load the configuration file.
43
+
44
+ ## AUTHORS
45
+
46
+ Will Speak (@willspeak)
47
+
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: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Speak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-17 00:00:00.000000000 Z
11
+ date: 2013-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -52,23 +52,50 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ronn
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.7.3
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.7.3
55
69
  description: A simple language and test system agnostic continuous test runner.
56
70
  email: lithiumflame@gmail.com
57
71
  executables:
58
72
  - snooper
59
73
  extensions: []
60
- extra_rdoc_files: []
74
+ extra_rdoc_files:
75
+ - man/snooper-config.7.ronn
76
+ - man/snooper.1.ronn
77
+ - LICENCE.md
78
+ - README.md
61
79
  files:
62
- - lib/snooper.rb
63
80
  - lib/snooper/snoop.rb
81
+ - lib/snooper.rb
64
82
  - bin/snooper
83
+ - man/snooper-config.7
84
+ - man/snooper-config.7.html
85
+ - man/snooper-config.7.ronn
86
+ - man/snooper.1
87
+ - man/snooper.1.html
88
+ - man/snooper.1.ronn
65
89
  - LICENCE.md
90
+ - README.md
66
91
  homepage: http://github.com/iwillspeak/snooper
67
92
  licenses:
68
93
  - Snooper is Open Source! See the LICENCE.md for more information.
69
94
  metadata: {}
70
95
  post_install_message:
71
- rdoc_options: []
96
+ rdoc_options:
97
+ - --main
98
+ - README.md
72
99
  require_paths:
73
100
  - lib
74
101
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -88,3 +115,4 @@ signing_key:
88
115
  specification_version: 4
89
116
  summary: Spying on Tests
90
117
  test_files: []
118
+ has_rdoc: