quality 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/quality/quality_checker.rb +3 -3
- data/lib/quality/rake/task.rb +9 -1
- data/lib/quality/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31d7f1e9e1e6e90a6db8e07a32456911ff32ea89
|
4
|
+
data.tar.gz: 87bf327990d23b23586a36c9777cca45cba258e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bc72415669e1c429ad540fd64540320a08cfccd62ee56df64ccc3be630d469477bcf0485495085ec5138f7cb25a7a2fc57a59f37a4785d369911181c1319375
|
7
|
+
data.tar.gz: 75c981ed751f6edfc69be3ac47e1e699ddc2282f1489435f6152bb7eb6eaf317482a4d5eaf1f8a39d2fb1e04fd3b500f12cfc5d3add1f761a1fc3d3acfc83c66
|
data/README.md
CHANGED
@@ -65,6 +65,11 @@ Quality::Rake::Task.new { |t|
|
|
65
65
|
# Defaults to []
|
66
66
|
t.skip_tools = []
|
67
67
|
|
68
|
+
# Log command executation
|
69
|
+
#
|
70
|
+
# Defaults to false
|
71
|
+
t.verbose = false
|
72
|
+
|
68
73
|
# Array of directory names which contain ruby files to analyze.
|
69
74
|
#
|
70
75
|
# Defaults to %w{app lib test spec feature}, which translates to *.rb in the base directory, as well as those directories.
|
@@ -6,14 +6,13 @@ module Quality
|
|
6
6
|
# number of violations for that command, and decreases that number
|
7
7
|
# if possible, or outputs data if the number of violations increased.
|
8
8
|
class QualityChecker
|
9
|
-
def initialize(cmd, command_options, output_dir, dependencies = {})
|
9
|
+
def initialize(cmd, command_options, output_dir, verbose, dependencies = {})
|
10
10
|
@count_file = dependencies[:count_file] || File
|
11
11
|
@count_io = dependencies[:count_io] || IO
|
12
12
|
@command_output_processor_class =
|
13
13
|
dependencies[:command_output_processor_class] ||
|
14
14
|
Quality::CommandOutputProcessor
|
15
|
-
@cmd = cmd
|
16
|
-
@command_options = command_options
|
15
|
+
@cmd, @command_options, @verbose = cmd, command_options, verbose
|
17
16
|
@count_dir = dependencies[:count_dir] || Dir
|
18
17
|
@count_dir.mkdir(output_dir) unless @count_file.exists?(output_dir)
|
19
18
|
@filename = File.join(output_dir, "#{cmd}_high_water_mark")
|
@@ -40,6 +39,7 @@ module Quality
|
|
40
39
|
def run_command(processor, &count_violations_on_line)
|
41
40
|
runner = @process_runner_class.new(full_cmd)
|
42
41
|
|
42
|
+
puts full_cmd if @verbose
|
43
43
|
runner.run do |file|
|
44
44
|
processor.file = file
|
45
45
|
@command_output = processor.process(&count_violations_on_line)
|
data/lib/quality/rake/task.rb
CHANGED
@@ -48,6 +48,11 @@ module Quality
|
|
48
48
|
# Defaults to []
|
49
49
|
attr_accessor :skip_tools
|
50
50
|
|
51
|
+
# Log command executation
|
52
|
+
#
|
53
|
+
# Defaults to false
|
54
|
+
attr_accessor :verbose
|
55
|
+
|
51
56
|
# Array of directory names which contain ruby files to analyze.
|
52
57
|
#
|
53
58
|
# Defaults to %w(app lib test spec feature), which translates to *.rb in
|
@@ -66,6 +71,8 @@ module Quality
|
|
66
71
|
|
67
72
|
@skip_tools = []
|
68
73
|
|
74
|
+
@verbose = false
|
75
|
+
|
69
76
|
@output_dir = 'metrics'
|
70
77
|
|
71
78
|
yield self if block_given?
|
@@ -180,7 +187,8 @@ module Quality
|
|
180
187
|
&count_violations_on_line)
|
181
188
|
quality_checker = @quality_checker_class.new(cmd,
|
182
189
|
command_options,
|
183
|
-
@output_dir
|
190
|
+
@output_dir,
|
191
|
+
verbose)
|
184
192
|
quality_checker.execute(&count_violations_on_line)
|
185
193
|
end
|
186
194
|
|
data/lib/quality/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quality
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cane
|