corundum 0.3.9 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,6 @@ module Corundum
14
14
 
15
15
  setting(:config_path, nil)
16
16
 
17
- setting(:sub_dir, "coverage")
18
17
  setting(:config_file, ".simplecov")
19
18
  setting(:filters, ["./spec"])
20
19
  setting(:threshold, 80)
@@ -23,12 +22,16 @@ module Corundum
23
22
  /\.rb$/ =~ path
24
23
  end)
25
24
 
25
+ dir(:target_dir,
26
+ path(:coverage_json, "coverage.json"))
27
+
26
28
  setting(:test_options, [])
27
29
 
28
30
  setting :qa_rejections, nil
29
31
 
30
32
  def default_configuration(toolkit, testlib)
31
33
  super(toolkit)
34
+ target_dir.relative_path = "coverage"
32
35
  self.test_lib = testlib
33
36
  self.code_files = toolkit.files.code
34
37
  self.all_files = toolkit.file_lists.project + toolkit.file_lists.code + toolkit.file_lists.test
@@ -73,31 +76,48 @@ module Corundum
73
76
  puts config_file_contents
74
77
  end
75
78
 
76
- task :config_exists do
77
- File::exists?(config_path) or fail "No .simplecov (try: rake #{self[:example_config]})"
78
- File::read(config_path) =~ /coverage_dir.*#{target_dir}/ or fail ".simplecov doesn't refer to #{target_dir}"
79
+ config_exists = task :config_exists do
80
+ problems = []
81
+ File::exists?(config_path) or problems << "No .simplecov (try: rake #{self[:example_config]})"
82
+ config_string = File.read(config_path)
83
+ unless config_string =~ /coverage_dir.*#{target_dir.pathname.relative_path_from(Pathname.pwd)}/
84
+ problems << ".simplecov doesn't refer to #{target_dir}"
85
+ end
86
+ unless config_string =~ /SimpleCov::Formatter::JSONFormatter/
87
+ problems << ".simplecov doesn't refer to SimpleCov::Formatter::JSONFormatter"
88
+ end
89
+ fail problems.join("\n") unless problems.empty?
79
90
  end
80
91
 
81
- @test_lib.doc_task(:report => [:config_exists] + all_files) do |t|
82
- t.rspec_opts = %w{-r simplecov -f progress} + test_options + t.rspec_opts
92
+ class << config_exists
93
+ attr_accessor :config_path
94
+
95
+ def timestamp
96
+ if File.exist?(config_path)
97
+ File.mtime(config_path.to_s)
98
+ else
99
+ Rake::EARLY
100
+ end
101
+ end
83
102
  end
84
- file entry_path => :report
103
+ config_exists.config_path = config_path
85
104
 
86
- task :generate_report => [:config_exists, entry_path]
105
+ @test_lib.report_task.rspec_opts << "-r simplecov"
106
+ file entry_point => @test_lib.report_task.name
107
+ file coverage_json => @test_lib.report_task.name
87
108
 
88
- task :verify_coverage => :generate_report do
89
- require 'nokogiri'
109
+ task :verify_coverage => coverage_json do
110
+ require 'json'
90
111
  require 'corundum/qa-report'
91
112
 
92
- doc = Nokogiri::parse(File::read(entry_path))
113
+ doc = JSON::parse(File::read(coverage_json.to_s))
93
114
 
94
- coverage_total_xpath = "//span[@class='covered_percent']/span"
95
- percentage = doc.xpath(coverage_total_xpath).first.content.to_f
115
+ percentage = doc["metrics"]["covered_percent"]
96
116
 
97
117
  report = QA::Report.new("Coverage")
98
118
  report.summary_counts = false
99
- report.add("percentage", entry_path, nil, percentage)
100
- report.add("threshold", entry_path, nil, threshold)
119
+ report.add("percentage", entry_point, nil, percentage.round(2))
120
+ report.add("threshold", entry_point, nil, threshold)
101
121
  qa_rejections << report
102
122
 
103
123
  if percentage < threshold
@@ -105,16 +125,14 @@ module Corundum
105
125
  end
106
126
  end
107
127
 
108
- task :find_stragglers => :generate_report do
109
- require 'nokogiri'
128
+ task :find_stragglers => coverage_json do
129
+ require 'json'
110
130
  require 'corundum/qa-report'
111
131
 
112
- doc = Nokogiri::parse(File::read(entry_path))
132
+ doc = JSON::parse(File::read(coverage_json.to_s))
113
133
 
114
- covered_files = doc.xpath(
115
- "//table[@class='file_list']//td//a[@class='src_link']").map do |link|
116
- link.content
117
- end
134
+ pwd = Pathname.pwd
135
+ covered_files = doc["files"].map{|f| Pathname.new(f["filename"]).relative_path_from(pwd).to_s}
118
136
  need_coverage = code_files.find_all(&coverage_filter)
119
137
 
120
138
  report = QA::Report.new("Stragglers")
@@ -133,6 +151,9 @@ module Corundum
133
151
  end
134
152
  end
135
153
 
154
+ task @test_lib.report_task.name => in_namespace(:config_exists)
155
+ task @test_lib.report_task.name => all_files
156
+
136
157
  task :preflight => in_namespace(:config_exists)
137
158
  task :run_quality_assurance => in_namespace(:verify_coverage, :find_stragglers)
138
159
  task :run_continuous_integration => in_namespace(:verify_coverage, :find_stragglers)
@@ -4,9 +4,6 @@ require 'corundum/simplecov'
4
4
  require 'corundum/gemspec_files'
5
5
  require 'corundum/gem_building'
6
6
  require 'corundum/gemcutter'
7
- require 'corundum/email'
8
7
  require 'corundum/version_control/monotone'
9
8
  require 'corundum/version_control/git'
10
- require 'corundum/documentation'
11
- require 'corundum/github-pages'
12
9
  require 'corundum/questionable-content'
@@ -9,7 +9,7 @@ module Corundum
9
9
  def default_configuration(toolkit)
10
10
  super
11
11
  self.gemspec = toolkit.gemspec
12
- self.build_finished_file = toolkit.finished_files.build
12
+ self.build_finished_file = toolkit.build_file.abspath
13
13
  self.gemspec_files = toolkit.files.code + toolkit.files.test
14
14
  self.tag = toolkit.gemspec.version.to_s
15
15
  end
@@ -7,7 +7,7 @@ module Corundum
7
7
 
8
8
  def default_configuration(toolkit)
9
9
  super
10
- self.build_finished_task = toolkit.finished_files.build
10
+ self.build_finished_task = toolkit.build_file.abspath
11
11
  end
12
12
 
13
13
  def resolve_configuration
@@ -101,7 +101,7 @@ module Corundum
101
101
 
102
102
  task :check_in => [:push]
103
103
  end
104
- task build_finished_task => in_namespace("is_checked_in")
104
+ file build_finished_task => in_namespace("is_checked_in")
105
105
  end
106
106
  end
107
107
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corundum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Judson Lester
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-22 00:00:00.000000000 Z
11
+ date: 2014-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: corundum
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.1
27
- - !ruby/object:Gem::Dependency
28
- name: rdoc
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: paint
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,34 +38,6 @@ dependencies:
52
38
  - - ~>
53
39
  - !ruby/object:Gem::Version
54
40
  version: 0.8.7
55
- - !ruby/object:Gem::Dependency
56
- name: yard
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: mailfactory
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- version: 1.4.0
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ~>
81
- - !ruby/object:Gem::Version
82
- version: 1.4.0
83
41
  - !ruby/object:Gem::Dependency
84
42
  name: rspec
85
43
  requirement: !ruby/object:Gem::Requirement
@@ -123,19 +81,19 @@ dependencies:
123
81
  - !ruby/object:Gem::Version
124
82
  version: '0'
125
83
  - !ruby/object:Gem::Dependency
126
- name: nokogiri
84
+ name: simplecov-json
127
85
  requirement: !ruby/object:Gem::Requirement
128
86
  requirements:
129
87
  - - ! '>='
130
88
  - !ruby/object:Gem::Version
131
- version: '0'
89
+ version: '0.2'
132
90
  type: :runtime
133
91
  prerelease: false
134
92
  version_requirements: !ruby/object:Gem::Requirement
135
93
  requirements:
136
94
  - - ! '>='
137
95
  - !ruby/object:Gem::Version
138
- version: '0'
96
+ version: '0.2'
139
97
  - !ruby/object:Gem::Dependency
140
98
  name: caliph
141
99
  requirement: !ruby/object:Gem::Requirement
@@ -156,39 +114,25 @@ dependencies:
156
114
  requirements:
157
115
  - - ~>
158
116
  - !ruby/object:Gem::Version
159
- version: '0.8'
117
+ version: '0.9'
160
118
  type: :runtime
161
119
  prerelease: false
162
120
  version_requirements: !ruby/object:Gem::Requirement
163
121
  requirements:
164
122
  - - ~>
165
123
  - !ruby/object:Gem::Version
166
- version: '0.8'
167
- - !ruby/object:Gem::Dependency
168
- name: compass
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
173
- version: 0.12.1
174
- type: :runtime
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ! '>='
179
- - !ruby/object:Gem::Version
180
- version: 0.12.1
124
+ version: '0.9'
181
125
  description: ! " A corundum is a synthetic gemstone - including synthetic rubies.
182
- \ Ergo: a tool for synthesizing gems.\n\n Corundum starts with the outlook that
183
- gemspecs are relatively easy to work with, and that the opinion of the RubyGems
184
- team is that they should be treated as a configuration file, not a code file. Furthermore,
185
- Rake is a powerful, easy to use tool, and does admit the use of Ruby code to get
186
- the job done.\n\n The hard part about publishing gems is getting them into a state
187
- you'll be proud of. There's dozens of fiddly steps to putting together a gem fit
188
- for public consumption, and it's very easy to get some of them wrong.\n\n Corundum
189
- is a collection of Rake tasklibs, therefore, that will perform the entire process
190
- of releasing gems, including QA steps up front through generating and publishing
191
- documentation.\n"
126
+ \ Ergo: a\n tool for synthesizing gems.\n\n Corundum starts with the outlook that
127
+ gemspecs are relatively easy to work\n with, and that the opinion of the RubyGems
128
+ team is that they should be\n treated as a configuration file, not a code file.
129
+ \ Furthermore, Rake is a\n powerful, easy to use tool, and does admit the use of
130
+ Ruby code to get the\n job done.\n\n The hard part about publishing gems is getting
131
+ them into a state you'll be\n proud of. There's dozens of fiddly steps to putting
132
+ together a gem fit for\n public consumption, and it's very easy to get some of
133
+ them wrong.\n\n Corundum is a collection of Rake tasklibs, therefore, that will
134
+ perform the\n entire process of releasing gems, including QA steps up front through\n
135
+ \ packaging and releasing the gem\n"
192
136
  email:
193
137
  - nyarly@gmail.com
194
138
  executables:
@@ -254,16 +198,11 @@ files:
254
198
  - lib/corundum/core.rb
255
199
  - lib/corundum/qa-report.rb
256
200
  - lib/corundum/browser-task.rb
257
- - lib/corundum/github-pages.rb
258
201
  - lib/corundum/rspec.rb
259
202
  - lib/corundum/rspec-task.rb
260
- - lib/corundum/email.rb
261
203
  - lib/corundum/gemspec_files.rb
262
204
  - lib/corundum/gemcutter.rb
263
- - lib/corundum/documentation.rb
264
205
  - lib/corundum/documentation-task.rb
265
- - lib/corundum/documentation/yardoc.rb
266
- - lib/corundum/documentation/assembly.rb
267
206
  - lib/corundum/gem_building.rb
268
207
  - lib/corundum/tasklibs.rb
269
208
  - lib/corundum/simplecov.rb
@@ -277,13 +216,6 @@ files:
277
216
  - lib/corundum/default_configuration/skel-files/gemfile
278
217
  - lib/corundum/default_configuration/skel-files/travis
279
218
  - lib/corundum/default_configuration/skel-files/simplecov
280
- - lib/corundum/default_configuration/templates/doc_assembly/index.html.erb
281
- - lib/corundum/default_configuration/templates/doc_assembly/theme/sass/styles.scss
282
- - lib/corundum/default_configuration/templates/doc_assembly/stylesheet.scss
283
- - lib/corundum/default_configuration/templates/doc_assembly/theme/stylesheets/pygment_trac.css
284
- - lib/corundum/default_configuration/templates/doc_assembly/theme/stylesheets/styles.css
285
- - lib/corundum/default_configuration/templates/doc_assembly/theme/javascripts/scale.fix.js
286
- - lib/corundum/default_configuration/templates/doc_assembly/theme/images/checker.png
287
219
  - README.md
288
220
  - spec/smoking_spec.rb
289
221
  - spec_help/spec_helper.rb
@@ -349,7 +281,7 @@ metadata: {}
349
281
  post_install_message:
350
282
  rdoc_options:
351
283
  - --title
352
- - corundum-0.3.9 RDoc
284
+ - corundum-0.4.0 RDoc
353
285
  require_paths:
354
286
  - lib/
355
287
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -1,40 +0,0 @@
1
- <html>
2
- <head>
3
- <link rel="stylesheet" href="stylesheet.css" type="text/css" />
4
- <title><%= gemspec.name.sub(/./){|ch| ch.upcase} %> <%=gemspec.version %></title>
5
- </head>
6
- <body>
7
- <div class="wrapper">
8
- <header>
9
- <div class="headers">
10
- <h1><%= gemspec.name.sub(/./){|ch| ch.upcase} %></h1>
11
- <h2><%= gemspec.summary %></h2>
12
- <h2>(current version: <%= gemspec.version %>)</h2>
13
- </div>
14
- </header>
15
- <section>
16
- <p><%= gemspec.description.gsub(/\n\s*\n/, "</p><p>") %></p>
17
- </section>
18
- <section class="documentation-list">
19
- <p>Documentation is in a few sections:</p>
20
- <ul>
21
- <% documenters.each_pair do |path, doccer| %>
22
- <li><a href="<%= doccer.entry_link %>"><%= doccer.title%></a></li>
23
- <% end %>
24
- <% external_docs.each_pair do |name, link| %>
25
- <li><a href="<%= link %>"><%= name %></a></li>
26
- <% end %>
27
- </ul>
28
- </section>
29
- <section class="credits">
30
- <h2>Authors</h2>
31
- <dl>
32
- <% gemspec.authors.zip(gemspec.email).each do |author, email| %>
33
- <dt><%= author %></dt>
34
- <dd><%= email %></dd>
35
- <% end %>
36
- </dl>
37
- </section>
38
- </div>
39
- </body>
40
- </html>
@@ -1,326 +0,0 @@
1
- @import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
2
- @import 'compass';
3
-
4
-
5
- html {
6
- background:#6C7989;
7
- @include background(#6C7989 linear_gradient(#6C7989, #434B55) fixed);
8
- }
9
-
10
- body {
11
- padding:50px 0;
12
- margin:0;
13
- font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
14
- color:#555;
15
- font-weight:300;
16
- background:inline-image('checker.png') fixed;
17
- }
18
-
19
- .wrapper {
20
- width:640px;
21
- margin:0 auto;
22
- background:#DEDEDE;
23
- @include border-radius(8px);
24
- @include box-shadow(rgba(#000, 0.2) 0 0 0 1px, rgba(#000, 0.45) 0 3px 10px);
25
- }
26
-
27
- header, section, footer {
28
- display:block;
29
- }
30
-
31
- a {
32
- color:#069;
33
- text-decoration:none;
34
- }
35
-
36
- p {
37
- margin:0 0 20px;
38
- padding:0;
39
- }
40
-
41
- strong {
42
- color:#222;
43
- font-weight:700;
44
- }
45
-
46
- header {
47
- @include border-radius(8px 8px 0 0);
48
- background:#C6EAFA;
49
- @include background(linear_gradient(#DDFBFC, #C6EAFA));
50
- position:relative;
51
- padding:15px 20px;
52
- border-bottom:1px solid #B2D2E1;
53
-
54
- h1 {
55
- margin:0;
56
- padding:0;
57
- font-size:24px;
58
- line-height:1.2;
59
- color:#069;
60
- text-shadow:rgba(#fff, 0.9) 0 1px 0;
61
- }
62
-
63
- &.without-description h1 {
64
- margin:10px 0;
65
- }
66
-
67
- p {
68
- margin:0;
69
- color:#61778B;
70
- width:300px;
71
- font-size:13px;
72
-
73
- &.view {
74
- display:none;
75
- font-weight:700;
76
- text-shadow:rgba(#fff, 0.9) 0 1px 0;
77
- -webkit-font-smoothing:antialiased;
78
-
79
- a {
80
- color:#06c;
81
- }
82
-
83
- small {
84
- font-weight:400;
85
- }
86
- }
87
- }
88
-
89
- ul {
90
- margin:0;
91
- padding:0;
92
- list-style:none;
93
- position:absolute;
94
- z-index:1;
95
- right:20px;
96
- top:20px;
97
- height:38px;
98
- padding:1px 0;
99
- background:#5198DF;
100
- @include background(linear_gradient(#77B9FB, #3782CD));
101
- border-radius:5px;
102
- @include box-shadow(inset rgba(#fff, 0.45) 0 1px 0, inset rgba(#000, 0.2) 0 -1px 0);
103
- width:240px;
104
-
105
- &:before {
106
- content:'';
107
- position:absolute;
108
- z-index:-1;
109
- left:-5px;
110
- top:-4px;
111
- right:-5px;
112
- bottom:-6px;
113
- background:rgba(#000, 0.1);
114
- @include border-radius(8px);
115
- @include box-shadow(rgba(#000, 0.2) 0 -1px 0, inset rgba(#fff, 0.7) 0 -1px 0);
116
- }
117
-
118
- li {
119
- width:79px;
120
- float:left;
121
- border-right:1px solid #3A7CBE;
122
- height:38px;
123
- }
124
-
125
- li + li {
126
- width:78px;
127
- border-left:1px solid #8BBEF3;
128
- }
129
-
130
- li + li + li {
131
- border-right:none;
132
- width:79px;
133
- }
134
-
135
- a {
136
- line-height:1;
137
- font-size:11px;
138
- color:#fff;
139
- color:rgba(#fff, 0.8);
140
- display:block;
141
- text-align:center;
142
- font-weight:400;
143
- padding-top:6px;
144
- height:40px;
145
- text-shadow:rgba(#000, 0.4) 0 -1px 0;
146
-
147
- strong {
148
- font-size:14px;
149
- display:block;
150
- color:#fff;
151
- -webkit-font-smoothing:antialiased;
152
- }
153
- }
154
- }
155
- }
156
-
157
- section {
158
- padding:15px 20px;
159
- font-size:15px;
160
- border-top:1px solid #fff;
161
- @include background(linear_gradient(#fafafa, #DEDEDE 700px));
162
- @include border-radius(0 0 8px 8px);
163
- position:relative;
164
- }
165
-
166
- h1, h2, h3, h4, h5, h6 {
167
- color:#222;
168
- padding:0;
169
- margin:0 0 20px;
170
- line-height:1.2;
171
- }
172
-
173
- p, ul, ol, table, pre, dl {
174
- margin:0 0 20px;
175
- }
176
-
177
- h1, h2, h3 {
178
- line-height:1.1;
179
- }
180
-
181
- h1 {
182
- font-size:28px;
183
- }
184
-
185
- h2 {
186
- color:#393939;
187
- }
188
-
189
- h3, h4, h5, h6 {
190
- color:#494949;
191
- }
192
-
193
- blockquote {
194
- margin:0 -20px 20px;
195
- padding:15px 20px 1px 40px;
196
- font-style:italic;
197
- background:#ccc;
198
- background:rgba(#000, 0.06);
199
- color:#222;
200
- }
201
-
202
- img {
203
- max-width:100%;
204
- }
205
-
206
- code, pre {
207
- font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
208
- color:#333;
209
- font-size:12px;
210
- overflow-x:auto;
211
- }
212
-
213
- pre {
214
- padding:20px;
215
- background: #3A3C42;
216
- color:#f8f8f2;
217
- margin:0 -20px 20px;
218
-
219
- code {
220
- color:#f8f8f2;
221
- }
222
-
223
- li & {
224
- margin-left:-60px;
225
- padding-left:60px;
226
- }
227
- }
228
-
229
- table {
230
- width:100%;
231
- border-collapse:collapse;
232
- }
233
-
234
- th, td {
235
- text-align:left;
236
- padding:5px 10px;
237
- border-bottom:1px solid #aaa;
238
- }
239
-
240
- dt {
241
- color:#222;
242
- font-weight:700;
243
- }
244
-
245
- th {
246
- color:#222;
247
- }
248
-
249
- small {
250
- font-size:11px;
251
- }
252
-
253
- hr {
254
- border:0;
255
- background:#aaa;
256
- height:1px;
257
- margin:0 0 20px;
258
- }
259
-
260
- footer {
261
- width:640px;
262
- margin:0 auto;
263
- padding:20px 0 0;
264
- color:#ccc;
265
- overflow:hidden;
266
-
267
- a {
268
- color:#fff;
269
- font-weight:bold;
270
- }
271
-
272
- p {
273
- float:left;
274
- }
275
-
276
- p + p {
277
- float:right;
278
- }
279
- }
280
-
281
- @media print, screen and (max-width: 740px) {
282
- body {
283
- padding:0;
284
- }
285
-
286
- .wrapper {
287
- @include border-radius(0);
288
- @include box-shadow(none);
289
- width:100%;
290
- }
291
-
292
- footer {
293
- @include border-radius(0);
294
- padding:20px;
295
- width:auto;
296
-
297
- p {
298
- float:none;
299
- margin:0;
300
- }
301
-
302
- p + p {
303
- float:none;
304
- }
305
- }
306
- }
307
-
308
- @media print, screen and (max-width:580px) {
309
- header ul {
310
- display:none;
311
- }
312
-
313
- header p.view {
314
- display:block;
315
- }
316
-
317
- header p {
318
- width:100%;
319
- }
320
- }
321
-
322
- @media print {
323
- header p.view a small:before {
324
- content:'at http://github.com/';
325
- }
326
- }