rake_command_filter 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/lib/command_definition.rb +6 -4
- data/lib/rake_command_filter/version.rb +1 -1
- data/lib/rspec_command_definition.rb +4 -4
- data/lib/rubocop_command_definition.rb +2 -2
- data/lib/scss_lint_command_definition.rb +3 -3
- data/lib/yard_command_definition.rb +2 -2
- data/test_cases/rspec/ok/coverage/.resultset.json +1 -1
- data/test_cases/rspec/ok/coverage/index.html +1 -1
- data/test_cases/yard/fail/doc/YardUndocumented.html +1 -1
- data/test_cases/yard/fail/doc/_index.html +1 -1
- data/test_cases/yard/fail/doc/index.html +1 -1
- data/test_cases/yard/fail/doc/top-level-namespace.html +1 -1
- data/test_cases/yard/ok/doc/YardDocumented.html +1 -1
- data/test_cases/yard/ok/doc/_index.html +1 -1
- data/test_cases/yard/ok/doc/index.html +1 -1
- data/test_cases/yard/ok/doc/top-level-namespace.html +1 -1
- data/test_cases/yard/warn/doc/YardDocumented.html +1 -1
- data/test_cases/yard/warn/doc/_index.html +1 -1
- data/test_cases/yard/warn/doc/index.html +1 -1
- data/test_cases/yard/warn/doc/top-level-namespace.html +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c265ab9b5d1788e22540ebeca1253dfd671f3da8
|
4
|
+
data.tar.gz: b9eff3e4090fd5d4ff0f8608f486d8cee64e9397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 376016640f6504b16f376639d2b34bd6393b761f1e04d06fab9f6b7ec90c0815510bbe50c982480ac2015dde6cc7c2400baafed69c91ed0f1f25e1f580b45442
|
7
|
+
data.tar.gz: 980acc4cd06f295c8e3d993e975abf9f258864cc8437483b02fdaf689bb5b685cbdb997cddcf9a91553c0997accf6fd1162698ae994b6556c027947355a5909c
|
data/README.md
CHANGED
@@ -47,9 +47,9 @@ Put this in your Rakefile, then run ```rake full_validation```.
|
|
47
47
|
```ruby
|
48
48
|
require 'rake_command_filter'
|
49
49
|
|
50
|
-
RakeCommandFilter::RakeTask.new(:
|
50
|
+
RakeCommandFilter::RakeTask.new(:validate) do
|
51
51
|
desc 'Run full validation'
|
52
|
-
run_definition(RakeCommandFilter::
|
52
|
+
run_definition(RakeCommandFilter::ScssLintCommandDefinition.new) do
|
53
53
|
add_parameter('app/assets/stylesheets')
|
54
54
|
end
|
55
55
|
run_definition(RakeCommandFilter::RubocopCommandDefinition.new)
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
8
8
|
RuboCop::RakeTask.new(:rubocop)
|
9
9
|
YARD::Rake::YardocTask.new(:yard)
|
10
10
|
|
11
|
-
RakeCommandFilter::RakeTask.new(:
|
11
|
+
RakeCommandFilter::RakeTask.new(:validate) do
|
12
12
|
desc 'Run full validation'
|
13
13
|
run_definition(RakeCommandFilter::RubocopCommandDefinition.new)
|
14
14
|
run_definition(RakeCommandFilter::RSpecCommandDefinition.new)
|
data/lib/command_definition.rb
CHANGED
@@ -48,23 +48,25 @@ module RakeCommandFilter
|
|
48
48
|
return worst
|
49
49
|
end
|
50
50
|
|
51
|
+
protected
|
52
|
+
|
51
53
|
# @return a result indicating the command was successful
|
52
|
-
def
|
54
|
+
def result_success(msg)
|
53
55
|
create_result(RakeCommandFilter::MATCH_SUCCESS, msg)
|
54
56
|
end
|
55
57
|
|
56
58
|
# @return a result indicating the command failed.
|
57
|
-
def
|
59
|
+
def result_failure(msg)
|
58
60
|
create_result(RakeCommandFilter::MATCH_FAILURE, msg)
|
59
61
|
end
|
60
62
|
|
61
63
|
# @return a result indicating the command showed a warning.
|
62
|
-
def
|
64
|
+
def result_warning(msg)
|
63
65
|
create_result(RakeCommandFilter::MATCH_WARNING, msg)
|
64
66
|
end
|
65
67
|
|
66
68
|
# used to create a result with the specified result code and msg
|
67
|
-
def
|
69
|
+
def create_result(result, msg)
|
68
70
|
LineFilterResult.new(@name, result, msg)
|
69
71
|
end
|
70
72
|
|
@@ -31,9 +31,9 @@ module RakeCommandFilter
|
|
31
31
|
add_filter(:rspec_filter, /(\d+)\s+example[s]?,\s+(\d+)\s+failure/) do |matches|
|
32
32
|
failures = matches[1].to_i
|
33
33
|
if failures > 0
|
34
|
-
|
34
|
+
result_failure(RSpecCommandDefinition.failure_msg(failures))
|
35
35
|
else
|
36
|
-
|
36
|
+
result_success(RSpecCommandDefinition.success_msg(matches[0]))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -43,9 +43,9 @@ module RakeCommandFilter
|
|
43
43
|
percent = matches[0].to_f
|
44
44
|
msg = RSpecCommandDefinition.coverage_msg(percent)
|
45
45
|
if percent >= coverage_threshold
|
46
|
-
|
46
|
+
result_success(msg)
|
47
47
|
else
|
48
|
-
|
48
|
+
result_failure(msg)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -18,11 +18,11 @@ module RakeCommandFilter
|
|
18
18
|
|
19
19
|
# just use sensible defaults here.
|
20
20
|
add_filter(:offenses_filter, /(\d+)\s+file.*,\s+(\d+)\s+offense/) do |matches|
|
21
|
-
|
21
|
+
result_failure(RubocopCommandDefinition.failure_msg(matches[1], matches[0]))
|
22
22
|
end
|
23
23
|
|
24
24
|
add_filter(:no_offenses_filter, /(\d+)\s+file.*,\s+no\s+offenses/) do |matches|
|
25
|
-
|
25
|
+
result_success(RubocopCommandDefinition.success_msg(matches[0]))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -18,9 +18,9 @@ module RakeCommandFilter
|
|
18
18
|
add_filter(:scss_error, /(.*\[(.)\].*)/) do |matches|
|
19
19
|
kind = matches[1]
|
20
20
|
if kind == 'W'
|
21
|
-
|
21
|
+
result_warning(ScssLintCommandDefinition.warning_msg)
|
22
22
|
else
|
23
|
-
|
23
|
+
result_failure(ScssLintCommandDefinition.error_msg)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -28,7 +28,7 @@ module RakeCommandFilter
|
|
28
28
|
protected
|
29
29
|
|
30
30
|
def create_default_result
|
31
|
-
|
31
|
+
result_success('No errors.')
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -22,10 +22,10 @@ module RakeCommandFilter
|
|
22
22
|
add_filter(:yard_percentage, /(\d+.?\d+)%\s+document/) do |matches|
|
23
23
|
percent = matches[0].to_f
|
24
24
|
msg = YardCommandDefinition.percent_msg(percent)
|
25
|
-
(percent >= threshold) ?
|
25
|
+
(percent >= threshold) ? result_success(msg) : result_failure(msg)
|
26
26
|
end
|
27
27
|
add_filter(:yard_warning, /\[warn\]:(.*)/) do |_matches|
|
28
|
-
|
28
|
+
result_warning(YardCommandDefinition.warning_msg)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.10.0/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2016-02-12T09:
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2016-02-12T09:59:06-06:00">2016-02-12T09:59:06-06:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
@@ -297,7 +297,7 @@
|
|
297
297
|
</div>
|
298
298
|
|
299
299
|
<div id="footer">
|
300
|
-
Generated on Fri Feb 12 09:
|
300
|
+
Generated on Fri Feb 12 09:59:02 2016 by
|
301
301
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
302
302
|
0.8.7.6 (ruby-2.2.3).
|
303
303
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on Fri Feb 12 09:
|
106
|
+
Generated on Fri Feb 12 09:59:02 2016 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.6 (ruby-2.2.3).
|
109
109
|
</div>
|
@@ -334,7 +334,7 @@
|
|
334
334
|
</div>
|
335
335
|
|
336
336
|
<div id="footer">
|
337
|
-
Generated on Fri Feb 12 09:
|
337
|
+
Generated on Fri Feb 12 09:59:03 2016 by
|
338
338
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
339
339
|
0.8.7.6 (ruby-2.2.3).
|
340
340
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on Fri Feb 12 09:
|
106
|
+
Generated on Fri Feb 12 09:59:03 2016 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.6 (ruby-2.2.3).
|
109
109
|
</div>
|
@@ -334,7 +334,7 @@
|
|
334
334
|
</div>
|
335
335
|
|
336
336
|
<div id="footer">
|
337
|
-
Generated on Fri Feb 12 09:
|
337
|
+
Generated on Fri Feb 12 09:59:08 2016 by
|
338
338
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
339
339
|
0.8.7.6 (ruby-2.2.3).
|
340
340
|
</div>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on Fri Feb 12 09:
|
106
|
+
Generated on Fri Feb 12 09:59:08 2016 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.6 (ruby-2.2.3).
|
109
109
|
</div>
|