tork 18.0.1 → 18.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.markdown CHANGED
@@ -1,3 +1,16 @@
1
+ ## Version 18.1.0 (2012-02-13)
2
+
3
+ Minor:
4
+
5
+ * Add `tork/config/coverage` configuration helper for Ruby 1.9, which prints
6
+ a coverage report at the end of your log file in YAML format. The report
7
+ is a hash containing the following information per each loaded Ruby file
8
+ that exist in or beneath the current working directory:
9
+
10
+ * :grade - percentage of C0 code coverage for source lines of code
11
+ * :nsloc - total number of source lines of code in the file
12
+ * :holes - line numbers of source lines that were not covered
13
+
1
14
  ## Version 18.0.1 (2012-02-13)
2
15
 
3
16
  Alert:
data/README.markdown CHANGED
@@ -133,6 +133,24 @@ file. So you must restart Tork accordingly if your configuration changes.
133
133
  In case you did not read the `tork --help` manual page, please note that you
134
134
  can pass *multiple* configuration helpers to tork(1) at the command line!
135
135
 
136
+ ### Code coverage (Ruby 1.9)
137
+
138
+ At the command line:
139
+
140
+ tork coverage
141
+
142
+ Or in your configuration file:
143
+
144
+ require 'tork/config/coverage'
145
+
146
+ This configuration helper prints a coverage report at the end of your log file
147
+ in YAML format. The report is a hash containing the following information per
148
+ each loaded Ruby file that exist in or beneath the current working directory:
149
+
150
+ * :grade - percentage of C0 code coverage for source lines of code
151
+ * :nsloc - total number of source lines of code in the file
152
+ * :holes - line numbers of source lines that were not covered
153
+
136
154
  ### [Ruby on Rails]
137
155
 
138
156
  At the command line:
data/bin/tork CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK 1 2012-02-13 18.0.1
4
+ # TORK 1 2012-02-26 18.1.0
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-driver CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-DRIVER 1 2012-02-13 18.0.1
4
+ # TORK-DRIVER 1 2012-02-26 18.1.0
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-engine CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-ENGINE 1 2012-02-13 18.0.1
4
+ # TORK-ENGINE 1 2012-02-26 18.1.0
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-herald CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-HERALD 1 2012-02-13 18.0.1
4
+ # TORK-HERALD 1 2012-02-26 18.1.0
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-master CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-MASTER 1 2012-02-13 18.0.1
4
+ # TORK-MASTER 1 2012-02-26 18.1.0
5
5
 
6
6
  ## NAME
7
7
 
@@ -0,0 +1,40 @@
1
+ require 'tork/config'
2
+
3
+ begin
4
+ require 'coverage'
5
+
6
+ Tork::Config.after_fork_hooks << proc do
7
+ Coverage.start
8
+ end
9
+
10
+ at_exit do
11
+ if not $! or ($!.kind_of? SystemExit and $!.success?) and
12
+ coverage_by_file = Coverage.result rescue nil
13
+ then
14
+ report = {}
15
+ coverage_by_file.each do |file, coverage|
16
+ # ignore files outside working directory
17
+ if file.start_with? Dir.pwd
18
+ nsloc = 0
19
+ holes = []
20
+ coverage.each_with_index do |hits, index|
21
+ # ignore non-source lines of code
22
+ unless hits.nil?
23
+ nsloc += 1
24
+ # +1 because line numbers go 1..N
25
+ holes << index + 1 if hits.zero?
26
+ end
27
+ end
28
+
29
+ grade = ((nsloc - holes.length) / nsloc.to_f) * 100
30
+ report[file] = { grade: grade, nsloc: nsloc, holes: holes }
31
+ end
32
+ end
33
+
34
+ require 'yaml'
35
+ YAML.dump report, STDOUT
36
+ end
37
+ end
38
+ rescue LoadError => error
39
+ warn "tork/config/coverage: #{error.inspect}"
40
+ end
data/lib/tork/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tork
2
- VERSION = "18.0.1"
2
+ VERSION = "18.1.0"
3
3
  end
@@ -1,4 +1,4 @@
1
- .TH TORK\-DRIVER 1 2012\-02\-13 18.0.1
1
+ .TH TORK\-DRIVER 1 2012\-02\-26 18.1.0
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-driver \- drives
@@ -1,4 +1,4 @@
1
- .TH TORK\-ENGINE 1 2012\-02\-13 18.0.1
1
+ .TH TORK\-ENGINE 1 2012\-02\-26 18.1.0
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-engine \- wraps
@@ -1,4 +1,4 @@
1
- .TH TORK\-HERALD 1 2012\-02\-13 18.0.1
1
+ .TH TORK\-HERALD 1 2012\-02\-26 18.1.0
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-herald \- reports modified files
@@ -1,4 +1,4 @@
1
- .TH TORK\-MASTER 1 2012\-02\-13 18.0.1
1
+ .TH TORK\-MASTER 1 2012\-02\-26 18.1.0
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-master \- absorbs overhead and runs tests
data/man/man1/tork.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH TORK 1 2012\-02\-13 18.0.1
1
+ .TH TORK 1 2012\-02\-26 18.1.0
2
2
  .SH NAME
3
3
  .PP
4
4
  tork \- Continuous testing tool for Ruby
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tork
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.0.1
4
+ version: 18.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-02-14 00:00:00.000000000 Z
13
+ date: 2012-02-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: binman
17
- requirement: &7179620 !ruby/object:Gem::Requirement
17
+ requirement: &19106960 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *7179620
25
+ version_requirements: *19106960
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: json
28
- requirement: &7178500 !ruby/object:Gem::Requirement
28
+ requirement: &19106080 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -36,10 +36,10 @@ dependencies:
36
36
  version: '2'
37
37
  type: :runtime
38
38
  prerelease: false
39
- version_requirements: *7178500
39
+ version_requirements: *19106080
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: guard
42
- requirement: &7177640 !ruby/object:Gem::Requirement
42
+ requirement: &19104800 !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
45
45
  - - ~>
@@ -47,10 +47,10 @@ dependencies:
47
47
  version: '1'
48
48
  type: :runtime
49
49
  prerelease: false
50
- version_requirements: *7177640
50
+ version_requirements: *19104800
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: diff-lcs
53
- requirement: &7177060 !ruby/object:Gem::Requirement
53
+ requirement: &19103360 !ruby/object:Gem::Requirement
54
54
  none: false
55
55
  requirements:
56
56
  - - ! '>='
@@ -61,10 +61,10 @@ dependencies:
61
61
  version: '2'
62
62
  type: :runtime
63
63
  prerelease: false
64
- version_requirements: *7177060
64
+ version_requirements: *19103360
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: md2man
67
- requirement: &7176180 !ruby/object:Gem::Requirement
67
+ requirement: &19101600 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
70
  - - ~>
@@ -72,10 +72,10 @@ dependencies:
72
72
  version: '1'
73
73
  type: :development
74
74
  prerelease: false
75
- version_requirements: *7176180
75
+ version_requirements: *19101600
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rake
78
- requirement: &7175240 !ruby/object:Gem::Requirement
78
+ requirement: &19100640 !ruby/object:Gem::Requirement
79
79
  none: false
80
80
  requirements:
81
81
  - - ! '>='
@@ -86,7 +86,7 @@ dependencies:
86
86
  version: '1'
87
87
  type: :development
88
88
  prerelease: false
89
- version_requirements: *7175240
89
+ version_requirements: *19100640
90
90
  description: Runs your tests as they change, in parallel.
91
91
  email:
92
92
  - sunaku@gmail.com
@@ -113,6 +113,7 @@ files:
113
113
  - bin/tork-master
114
114
  - lib/tork/client.rb
115
115
  - lib/tork/config.rb
116
+ - lib/tork/config/coverage.rb
116
117
  - lib/tork/config/cucumber.rb
117
118
  - lib/tork/config/dotlog.rb
118
119
  - lib/tork/config/factory_girl.rb
@@ -145,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
146
  version: '0'
146
147
  segments:
147
148
  - 0
148
- hash: 4154457537204892036
149
+ hash: -120880762580593238
149
150
  required_rubygems_version: !ruby/object:Gem::Requirement
150
151
  none: false
151
152
  requirements:
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  version: '0'
155
156
  segments:
156
157
  - 0
157
- hash: 4154457537204892036
158
+ hash: -120880762580593238
158
159
  requirements: []
159
160
  rubyforge_project:
160
161
  rubygems_version: 1.8.11