snooper 0.1.2 → 0.1.3

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: 639959cfe2996f00f5bd6976df7d9b5fcf85fa5b
4
- data.tar.gz: 516550f8991ab1a1342df9a850284d7f9dfaa2f9
3
+ metadata.gz: eeb6e88677b5b8c687e3f8df1133cbc346722bc5
4
+ data.tar.gz: 06f5c6b9199cc7d690301bd7fb9131df0b0207fe
5
5
  SHA512:
6
- metadata.gz: 6d870d3135e8a14f9acc8e2392267ee37d0b5ef1f1fa2c9bae8304c55906c80e283ddbda99f58c797e899aa1528a84e677b059ead3e4330fc0fc5146618163bb
7
- data.tar.gz: 4f0479712a392d3d3fd64ffc56087552c0f00908dd2ce3972d963c1a385c3c837b9b7ca6397c9cbc9a7ed0fbb0a7842382c1e1f634a19c39449484e3279db0b5
6
+ metadata.gz: ee2d98a6072efa25bf9cc876f678dcaa26a3cdf38b67b1de0214817ed30d426aa343438acfd29ddb9846efaaff3fcf28466d2a82d35fc08dc3d061fe0136ac40
7
+ data.tar.gz: c91bc76ccaaf03cdaf5f3a05e8792781c7a0829b49b46d301f5edcdc49d8035348466e26dde5acb608ac0a159bc3df34ed995e41e62dfc9d4e340015f6bbcae8
data/bin/snooper CHANGED
@@ -17,7 +17,7 @@ require 'yaml'
17
17
  def test_loop(options)
18
18
  begin
19
19
  dirs = options[:paths].empty? ? './' : options[:paths]
20
- Snooper.watch dirs, options
20
+ Snooper.watch dirs, options
21
21
  rescue Interrupt
22
22
  puts # This is where the ^C is on unix
23
23
  puts "Testing over, time for a coffee...".yellow
@@ -93,15 +93,15 @@ END
93
93
 
94
94
  yamopts.each do |option, argument|
95
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
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
105
  end
106
106
  end
107
107
 
@@ -123,4 +123,4 @@ options = get_options
123
123
  old_dir = File.expand_path '.'
124
124
  Dir.chdir options[:base_path] if options[:base_path]
125
125
  test_loop options
126
- Dir.chdir old_dir
126
+ Dir.chdir old_dir
data/lib/snooper.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # This program runs in the background watching for file changes. When a file
2
+ # This program runs in the background watching for file changes. When a file
3
3
  # change is dtected a command is run. It is intended to watch repos for changes
4
4
  # and run unit tests automatically when source files are changed.
5
5
  #
@@ -14,7 +14,7 @@
14
14
  module Snooper
15
15
 
16
16
  require 'snooper/snoop'
17
-
17
+
18
18
  ##
19
19
  # Watch for changes in a directory
20
20
  #
data/lib/snooper/snoop.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  # Author:: Will Speak (@willspeak)
2
3
  # Copyright:: Copyright (c) 2013 Will Speak
3
4
  # License:: Snoop is open source! See LICENCE.md for more details.
@@ -86,14 +87,14 @@ module Snooper
86
87
  ##
87
88
  # Prettify a status line
88
89
  #
89
- # Prints the message at the center of the line, automatically detected
90
+ # Prints the message at the center of the line, automatically detected
90
91
  # from the terminal info. If a block is supplied then the resulting message
91
92
  # is post-filtered by it before being returned.
92
93
  #
93
94
  # @param message - the message to print
94
95
 
95
96
  def statusbar(message)
96
- message = message.to_s.center TermInfo.screen_width
97
+ message = message.to_s.center TermInfo.screen_width - 1
97
98
  block_given? ? yield(message) : message
98
99
  end
99
100
 
@@ -118,4 +119,4 @@ module Snooper
118
119
  @listener.start
119
120
  end
120
121
  end
121
- end
122
+ end
@@ -3,8 +3,8 @@ module Snooper
3
3
  ##
4
4
  # The library version for this module
5
5
  #
6
- # This should conform to SemVer. If this is changed it should be the only
6
+ # This should conform to SemVer. If this is changed it should be the only
7
7
  # thing that changes in the comit.
8
8
 
9
- VERSION = '0.1.2'
10
- end
9
+ VERSION = '0.1.3'
10
+ end
@@ -0,0 +1,44 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "SNOOPER\-CONFIG" "7" "June 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)
42
+ .
43
+ .SH "AUTHORS"
44
+ Will Speak (@willspeak)
data/man/snooper.1 ADDED
@@ -0,0 +1,45 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "SNOOPER" "1" "June 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 snoop using the cofiguration in \fIsnooperrc\fR executing \fBecho Hello World!\fR when files change\.
37
+ .
38
+ .SH "BUGS"
39
+ Think you\'ve found a bug? Report it \fIhttp://github\.com/iwillspeak/snooper/issues\fR\.
40
+ .
41
+ .SH "SEE ALSO"
42
+ snooper\-config(7)
43
+ .
44
+ .SH "AUTHORS"
45
+ Will Speak (@willspeak)
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.1.2
4
+ version: 0.1.3
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-06-18 00:00:00.000000000 Z
11
+ date: 2013-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored
@@ -84,8 +84,10 @@ files:
84
84
  - lib/snooper/version.rb
85
85
  - lib/snooper.rb
86
86
  - bin/snooper
87
+ - man/snooper-config.7
87
88
  - man/snooper-config.7.html
88
89
  - man/snooper-config.7.ronn
90
+ - man/snooper.1
89
91
  - man/snooper.1.html
90
92
  - man/snooper.1.ronn
91
93
  - LICENCE.md
@@ -112,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
114
  version: '0'
113
115
  requirements: []
114
116
  rubyforge_project:
115
- rubygems_version: 2.0.0
117
+ rubygems_version: 2.0.2
116
118
  signing_key:
117
119
  specification_version: 4
118
120
  summary: Spying on Tests