quality 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/quality/rake/task.rb +22 -44
- data/lib/quality/tools/bigfiles.rb +1 -1
- data/lib/quality/version.rb +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: dff4cb6cb0b90287a909c4bcaacb3ab65bfccee9
|
4
|
+
data.tar.gz: c8e5409dfb6c3dbdbcac2e5ed0f9514db2b8e9fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 840c0c18e0266ed65a2ad45a69368e7ff436d7b9d02774e0a2a3dcd835272c54ccd1f02d72736e0b4faf3a635378a75e5d0d4b5bc917310d32864a6b572df228
|
7
|
+
data.tar.gz: 9537a85f64c028a6adac27cc84525a5eeb1281232e323c8692ab48d31b1033dc46c99c8547c174921d78cc2d08ecbf6c837bbb5a467e17d51bd3b7a620a7ebd5
|
data/lib/quality/rake/task.rb
CHANGED
@@ -68,8 +68,22 @@ module Quality
|
|
68
68
|
attr_writer :output_dir
|
69
69
|
|
70
70
|
# Defines a new task, using the name +name+.
|
71
|
-
def initialize(
|
72
|
-
|
71
|
+
def initialize(dsl: ::Rake::Task,
|
72
|
+
cmd_runner: Kernel,
|
73
|
+
count_file: File,
|
74
|
+
count_io: IO,
|
75
|
+
globber: Dir,
|
76
|
+
gem_spec: Gem::Specification,
|
77
|
+
configuration_writer: File,
|
78
|
+
quality_checker_class:
|
79
|
+
Quality::QualityChecker,
|
80
|
+
quality_name: 'quality',
|
81
|
+
ratchet_name: 'ratchet')
|
82
|
+
@dsl, @cmd_runner, @count_file = dsl, cmd_runner, count_file
|
83
|
+
@count_io, @globber, @gem_spec = count_io, globber, gem_spec
|
84
|
+
@configuration_writer = configuration_writer
|
85
|
+
@quality_checker_class = quality_checker_class
|
86
|
+
@quality_name, @ratchet_name = quality_name, ratchet_name
|
73
87
|
|
74
88
|
@skip_tools = []
|
75
89
|
|
@@ -82,46 +96,6 @@ module Quality
|
|
82
96
|
define
|
83
97
|
end
|
84
98
|
|
85
|
-
def parse_task_name_args(args)
|
86
|
-
@quality_name = args[:quality_name] || 'quality'
|
87
|
-
|
88
|
-
@ratchet_name = args[:ratchet_name] || 'ratchet'
|
89
|
-
end
|
90
|
-
|
91
|
-
def parse_args(args)
|
92
|
-
parse_task_name_args(args)
|
93
|
-
parse_unit_test_overrides(args)
|
94
|
-
end
|
95
|
-
|
96
|
-
def parse_unit_test_overrides(args)
|
97
|
-
# allow unit tests to override the class that Rake DSL
|
98
|
-
# messages are sent to.
|
99
|
-
@dsl = args[:dsl] || ::Rake::Task
|
100
|
-
|
101
|
-
# likewise, but for system()
|
102
|
-
@cmd_runner = args[:cmd_runner] || Kernel
|
103
|
-
|
104
|
-
# likewise, but for File.open() on the count files
|
105
|
-
@count_file = args[:count_file] || File
|
106
|
-
|
107
|
-
# likewise, but for IO.read()/IO.exist? on the count files
|
108
|
-
@count_io = args[:count_io] || IO
|
109
|
-
|
110
|
-
# likewise, but for Dir.glob() on target Ruby files
|
111
|
-
@globber = args[:globber] || Dir
|
112
|
-
|
113
|
-
# likewise, but for checking whether a gem is installed
|
114
|
-
@gem_spec = args[:gem_spec] || Gem::Specification
|
115
|
-
|
116
|
-
# uses exist?() and open() to write out configuration files
|
117
|
-
# for tools if needed (e.g., .cane file)
|
118
|
-
@configuration_writer = args[:configuration_writer] || File
|
119
|
-
|
120
|
-
# Class which actually runs the quality check commands
|
121
|
-
@quality_checker_class =
|
122
|
-
args[:quality_checker_class] || Quality::QualityChecker
|
123
|
-
end
|
124
|
-
|
125
99
|
private
|
126
100
|
|
127
101
|
def define # :nodoc:
|
@@ -198,9 +172,13 @@ module Quality
|
|
198
172
|
@ruby_dirs ||= %w(app lib test spec feature)
|
199
173
|
end
|
200
174
|
|
201
|
-
def
|
175
|
+
def source_files_glob(extensions = 'rb,swift,cpp,c,java,py')
|
202
176
|
File.join("{#{ruby_dirs.join(',')}}",
|
203
|
-
'**',
|
177
|
+
'**', "*.{#{extensions}}")
|
178
|
+
end
|
179
|
+
|
180
|
+
def ruby_files_glob
|
181
|
+
source_files_glob('rb')
|
204
182
|
end
|
205
183
|
|
206
184
|
def ruby_files
|
data/lib/quality/version.rb
CHANGED