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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6da33db01e0aa28bf058126cf2c218064bc7b23
4
- data.tar.gz: 44341e8177e2edcbdc1c4277fbeecf9439a6b82c
3
+ metadata.gz: c265ab9b5d1788e22540ebeca1253dfd671f3da8
4
+ data.tar.gz: b9eff3e4090fd5d4ff0f8608f486d8cee64e9397
5
5
  SHA512:
6
- metadata.gz: 1374a9869b8750de1ddd274d868ea42ff7e2fdb16656822e7922bad713af50390d6cec1bce4479f238032b34950a749ea6fde31c7471c754293b3407f3ad06eb
7
- data.tar.gz: da1ddebd4327c0cc8cafb97b3985eb6b7dd9d908418e7917ebbaac7a255408323f326c2cdb353a1de53f3f0bebace6150349ef38344bee90e247a6376ec548b4
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(:full_validation) do
50
+ RakeCommandFilter::RakeTask.new(:validate) do
51
51
  desc 'Run full validation'
52
- run_definition(RakeCommandFilter::RubocopCommandDefinition.new) do
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(:full_validation) do
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)
@@ -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 self.result_success(msg)
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 self.result_failure(msg)
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 self.result_warning(msg)
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 self.create_result(result, msg)
69
+ def create_result(result, msg)
68
70
  LineFilterResult.new(@name, result, msg)
69
71
  end
70
72
 
@@ -1,4 +1,4 @@
1
1
  module RakeCommandFilter
2
2
  # version of this gem
3
- VERSION = '0.1.1'.freeze
3
+ VERSION = '0.1.2'.freeze
4
4
  end
@@ -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
- CommandDefinition.result_failure(RSpecCommandDefinition.failure_msg(failures))
34
+ result_failure(RSpecCommandDefinition.failure_msg(failures))
35
35
  else
36
- CommandDefinition.result_success(RSpecCommandDefinition.success_msg(matches[0]))
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
- CommandDefinition.result_success(msg)
46
+ result_success(msg)
47
47
  else
48
- CommandDefinition.result_failure(msg)
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
- CommandDefinition.result_failure(RubocopCommandDefinition.failure_msg(matches[1], matches[0]))
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
- CommandDefinition.result_success(RubocopCommandDefinition.success_msg(matches[0]))
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
- CommandDefinition.result_warning(ScssLintCommandDefinition.warning_msg)
21
+ result_warning(ScssLintCommandDefinition.warning_msg)
22
22
  else
23
- CommandDefinition.result_failure(ScssLintCommandDefinition.error_msg)
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
- CommandDefinition.result_success('No errors.')
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) ? CommandDefinition.result_success(msg) : CommandDefinition.result_failure(msg)
25
+ (percent >= threshold) ? result_success(msg) : result_failure(msg)
26
26
  end
27
27
  add_filter(:yard_warning, /\[warn\]:(.*)/) do |_matches|
28
- CommandDefinition.result_warning(YardCommandDefinition.warning_msg)
28
+ result_warning(YardCommandDefinition.warning_msg)
29
29
  end
30
30
  end
31
31
  end
@@ -10,6 +10,6 @@
10
10
  null
11
11
  ]
12
12
  },
13
- "timestamp": 1455291802
13
+ "timestamp": 1455292746
14
14
  }
15
15
  }
@@ -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:43:22-06:00">2016-02-12T09:43:22-06:00</abbr></div>
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:43:19 2016 by
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>
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
 
94
94
  <div id="footer">
95
- Generated on Fri Feb 12 09:43:19 2016 by
95
+ Generated on Fri Feb 12 09:59:02 2016 by
96
96
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
97
97
  0.8.7.6 (ruby-2.2.3).
98
98
  </div>
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
 
94
94
  <div id="footer">
95
- Generated on Fri Feb 12 09:43:19 2016 by
95
+ Generated on Fri Feb 12 09:59:02 2016 by
96
96
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
97
97
  0.8.7.6 (ruby-2.2.3).
98
98
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Fri Feb 12 09:43:19 2016 by
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:43:20 2016 by
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>
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
 
94
94
  <div id="footer">
95
- Generated on Fri Feb 12 09:43:20 2016 by
95
+ Generated on Fri Feb 12 09:59:03 2016 by
96
96
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
97
97
  0.8.7.6 (ruby-2.2.3).
98
98
  </div>
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
 
94
94
  <div id="footer">
95
- Generated on Fri Feb 12 09:43:20 2016 by
95
+ Generated on Fri Feb 12 09:59:03 2016 by
96
96
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
97
97
  0.8.7.6 (ruby-2.2.3).
98
98
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Fri Feb 12 09:43:20 2016 by
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:43:25 2016 by
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>
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
 
94
94
  <div id="footer">
95
- Generated on Fri Feb 12 09:43:25 2016 by
95
+ Generated on Fri Feb 12 09:59:08 2016 by
96
96
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
97
97
  0.8.7.6 (ruby-2.2.3).
98
98
  </div>
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
 
94
94
  <div id="footer">
95
- Generated on Fri Feb 12 09:43:25 2016 by
95
+ Generated on Fri Feb 12 09:59:08 2016 by
96
96
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
97
97
  0.8.7.6 (ruby-2.2.3).
98
98
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Fri Feb 12 09:43:25 2016 by
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>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_command_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Jones