guard-prove 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Marian Schubert
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,43 @@
1
+ = Guard::Prove
2
+
3
+ Prove guard allows to automatically & intelligently launch Perl tests when
4
+ files are modified.
5
+
6
+ == Install
7
+
8
+ Please be sure to have {guard}[http://github.com/guard/guard] installed before
9
+ continue.
10
+
11
+ TODO: publish gem
12
+
13
+ == Usage
14
+
15
+ Please read {guard usage doc}[http://github.com/guard/guard#readme]
16
+
17
+ == Guardfile
18
+
19
+ guard 'prove' do
20
+ # prove modified test file
21
+ watch(%r{^.*\.t$})
22
+
23
+ # prove all files in t directory when some module gets modified
24
+ watch(%r{^.*\.pm$}) { "t" }
25
+
26
+ # prove path/t/file.t when path/file.pm gets modified
27
+ # watch(%r{^(.*)/([^./]+)\.pm$}) {|m| m[1] + "/t/" + m[2] + ".t"}
28
+ end
29
+
30
+ == Development
31
+
32
+ - Source hosted at {GitHub}[http://github.com/maio/guard-prove]
33
+ - Report issues/Questions/Feature requests on {GitHub Issues}[http://github.com/maio/guard-prove/issues]
34
+
35
+ Pull requests are very welcome! Make sure your patches are well tested. Please
36
+ create a topic branch for every separate change you make.
37
+
38
+ I would also appreciate code review of a current version from someone
39
+ experienced in Ruby, because this is the first time I'm using it.
40
+
41
+ == Authors
42
+
43
+ {Marian Schubert}[http://github.com/maio]
@@ -0,0 +1,36 @@
1
+ require 'systemu'
2
+ require 'guard'
3
+ require 'guard/guard'
4
+
5
+ module Guard
6
+ class Prove < Guard
7
+
8
+ VERSION = '1.0.0'
9
+
10
+ def run_on_change(paths)
11
+ paths.uniq!
12
+ paths.each { |path| run_prove(path) }
13
+ end
14
+
15
+ def run_prove(path)
16
+ command = "prove -r #{path}"
17
+ puts command
18
+ status, stdout, stderr = systemu command
19
+
20
+ if status.success?
21
+ ::Guard::Notifier.notify(stderr, :title => "PASS",
22
+ :image => :success)
23
+ else
24
+ ::Guard::Notifier.notify(stderr, :title => "FAIL",
25
+ :image => :failed)
26
+ end
27
+
28
+ puts stdout
29
+ puts
30
+ puts stderr
31
+ puts
32
+ puts
33
+ end
34
+ end
35
+ end
36
+
@@ -0,0 +1,10 @@
1
+ guard 'prove' do
2
+ # prove modified test file
3
+ watch(%r{^.*\.t$})
4
+
5
+ # prove all files in t directory when some module gets modified
6
+ watch(%r{^.*\.pm$}) { "t" }
7
+
8
+ # prove path/t/file.t when path/file.pm gets modified
9
+ # watch(%r{^(.*)/([^./]+)\.pm$}) {|m| m[1] + "/t/" + m[2] + ".t"}
10
+ end
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-prove
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ version: 1.0.0
10
+ platform: ruby
11
+ authors:
12
+ - Marian Schubert
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-02-07 00:00:00 +00:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: guard
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 3
30
+ - 0
31
+ version: 0.3.0
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: systemu
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 2
45
+ - 0
46
+ version: 1.2.0
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: bundler
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 1
59
+ - 0
60
+ - 7
61
+ version: 1.0.7
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ name: rspec
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ~>
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 2
74
+ - 2
75
+ - 0
76
+ version: 2.2.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *id004
80
+ description: Guard::Prove automatically run your Perl tests (much like autotest)
81
+ email:
82
+ - marian.schubert@gmail.com
83
+ executables: []
84
+
85
+ extensions: []
86
+
87
+ extra_rdoc_files: []
88
+
89
+ files:
90
+ - lib/guard/prove/templates/Guardfile
91
+ - lib/guard/prove.rb
92
+ - LICENSE
93
+ - README.rdoc
94
+ has_rdoc: true
95
+ homepage: http://rubygems.org/gems/guard-prove
96
+ licenses: []
97
+
98
+ post_install_message:
99
+ rdoc_options: []
100
+
101
+ require_paths:
102
+ - lib
103
+ required_ruby_version: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ segments:
117
+ - 1
118
+ - 3
119
+ - 6
120
+ version: 1.3.6
121
+ requirements: []
122
+
123
+ rubyforge_project: guard-prove
124
+ rubygems_version: 1.3.7
125
+ signing_key:
126
+ specification_version: 3
127
+ summary: Guard gem for prove
128
+ test_files: []
129
+