quality 3.0.0 → 3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5c378258be2a3a2154d61789d6f6e314c3b3d1a
4
- data.tar.gz: 715fe860836c163de2e34cb442ee8f8b22aec2b6
3
+ metadata.gz: dff4cb6cb0b90287a909c4bcaacb3ab65bfccee9
4
+ data.tar.gz: c8e5409dfb6c3dbdbcac2e5ed0f9514db2b8e9fe
5
5
  SHA512:
6
- metadata.gz: 0ea4e567b74d01ff3e326e14db1a10377cfef2df0a32a584c628e47b589cda97995f086b71ae7594e01f8e278f8a395dc66e8c17d8cb036cd01714e4aa5303e7
7
- data.tar.gz: 663eb51f3c0b22a3b540b8673bc0b48336aaa7abb575e146d391c51b712d59956482e8bc32a2679a215fe8fa223c88a096fd81cf8df2568e80144679a38a176b
6
+ metadata.gz: 840c0c18e0266ed65a2ad45a69368e7ff436d7b9d02774e0a2a3dcd835272c54ccd1f02d72736e0b4faf3a635378a75e5d0d4b5bc917310d32864a6b572df228
7
+ data.tar.gz: 9537a85f64c028a6adac27cc84525a5eeb1281232e323c8692ab48d31b1033dc46c99c8547c174921d78cc2d08ecbf6c837bbb5a467e17d51bd3b7a620a7ebd5
@@ -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(args = {})
72
- parse_args(args)
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 ruby_files_glob
175
+ def source_files_glob(extensions = 'rb,swift,cpp,c,java,py')
202
176
  File.join("{#{ruby_dirs.join(',')}}",
203
- '**', '*.rb')
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
@@ -6,7 +6,7 @@ module Quality
6
6
 
7
7
  def quality_bigfiles
8
8
  ratchet_quality_cmd('bigfiles',
9
- {}) do |line|
9
+ args: "--glob '#{source_files_glob}'") do |line|
10
10
  line.split(':')[0].to_i
11
11
  end
12
12
  end
@@ -2,5 +2,5 @@
2
2
  # reek, flog, flay and rubocop and makes sure your numbers don't get
3
3
  # any worse over time.
4
4
  module Quality
5
- VERSION = '3.0.0'
5
+ VERSION = '3.1.0'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz