quality 19.2.0 → 19.2.1
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 +12 -8
- data/lib/quality/tools/jscs.rb +2 -2
- data/lib/quality/tools/pep8.rb +2 -1
- data/lib/quality/tools/rubocop.rb +3 -0
- data/lib/quality/version.rb +1 -1
- data/lib/quality/which.rb +22 -11
- data/quality.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2419ec7a0304aabcffc4d406dbdb2d39b84ad6a6
|
4
|
+
data.tar.gz: 5e83cfabae5da03934da1e76376cc577c8b7cb27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2509162901590ebd0f194d3818199bd852833435e26a8939f2c22a10bb32d4c6ea6be4563b97524bfcd8ae9ba284755a835bcb2960db26abf097d9b726b9ecc
|
7
|
+
data.tar.gz: 9336568f5350230577438cba1da1a3f03ef522866d89d37403b2952f45b3a23eb213db388ca6c2f14f51faacf6ce4fb554df64ef967caf97b5bc34f95969d13e
|
data/README.md
CHANGED
@@ -57,14 +57,14 @@ $ rake ratchet
|
|
57
57
|
## Configuration options
|
58
58
|
|
59
59
|
```ruby
|
60
|
-
Quality::Rake::Task.new
|
60
|
+
Quality::Rake::Task.new do |t|
|
61
61
|
# Name of quality task.
|
62
62
|
# Defaults to :quality.
|
63
|
-
t.quality_name =
|
63
|
+
t.quality_name = 'quality'
|
64
64
|
|
65
65
|
# Name of ratchet task.
|
66
66
|
# Defaults to :ratchet.
|
67
|
-
t.ratchet_name =
|
67
|
+
t.ratchet_name = 'ratchet'
|
68
68
|
|
69
69
|
# Array of strings describing tools to be skipped--e.g., ["cane"]
|
70
70
|
#
|
@@ -78,10 +78,12 @@ Quality::Rake::Task.new { |t|
|
|
78
78
|
|
79
79
|
# Array of directory names which contain ruby files to analyze.
|
80
80
|
#
|
81
|
-
# Defaults to %w(app lib test spec feature), which translates to
|
81
|
+
# Defaults to %w(app lib test spec feature), which translates to
|
82
|
+
# *.rb in the base directory, as well as those directories.
|
82
83
|
t.ruby_dirs = %w(app lib test spec feature)
|
83
84
|
|
84
|
-
# Array of directory names which contain any type of source files to
|
85
|
+
# Array of directory names which contain any type of source files to
|
86
|
+
# analyze.
|
85
87
|
#
|
86
88
|
# Defaults to t.ruby_dirs
|
87
89
|
t.source_dirs.concat(%w(MyProject MyProjectTests))
|
@@ -95,12 +97,14 @@ Quality::Rake::Task.new { |t|
|
|
95
97
|
t.extra_ruby_files = ['Rakefile']
|
96
98
|
|
97
99
|
# Exclude the specified list of files--defaults to ['db/schema.rb']
|
98
|
-
t.exclude_files = ['lib/whatever/imported_file.rb',
|
100
|
+
t.exclude_files = ['lib/whatever/imported_file.rb',
|
101
|
+
'lib/vendor/someone_else_fault.rb']
|
99
102
|
|
100
103
|
# Alternately, express it as a glob:
|
101
104
|
|
102
105
|
# Exclude the specified list of files
|
103
|
-
t.source_files_exclude_glob =
|
106
|
+
t.source_files_exclude_glob =
|
107
|
+
'{lib/whatever/imported_file.rb,lib/vendor/**/*.rb}'
|
104
108
|
|
105
109
|
# Extensions for Ruby language files--defaults to 'rb,rake'
|
106
110
|
t.ruby_file_extensions_glob = 'rb,rake'
|
@@ -121,7 +125,7 @@ Quality::Rake::Task.new { |t|
|
|
121
125
|
#
|
122
126
|
# Defaults to 'XXX|TODO'
|
123
127
|
t.punchlist_regexp = 'XXX|TODO'
|
124
|
-
|
128
|
+
end
|
125
129
|
```
|
126
130
|
|
127
131
|
## Code coverage
|
data/lib/quality/tools/jscs.rb
CHANGED
@@ -9,10 +9,10 @@ module Quality
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def jscs_check_configured
|
12
|
-
return if js_files_arr.empty?
|
12
|
+
return 0 if js_files_arr.empty?
|
13
13
|
|
14
14
|
puts 'No JSCS config found! To generate one, run ' \
|
15
|
-
'jscs --auto-configure
|
15
|
+
'jscs --auto-configure representative_file.js'
|
16
16
|
0
|
17
17
|
end
|
18
18
|
|
data/lib/quality/tools/pep8.rb
CHANGED
data/lib/quality/version.rb
CHANGED
data/lib/quality/which.rb
CHANGED
@@ -1,14 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
# http://stackoverflow.com/questions/2108727/
|
2
|
+
# which-in-ruby-checking-if-program-exists-in-path-from-ruby
|
3
|
+
module Quality
|
4
|
+
# Determine where a given executable lives, like the UNIX 'which' command
|
5
|
+
class Which
|
6
|
+
def initialize(env: ENV,
|
7
|
+
file: File,
|
8
|
+
separator: File::PATH_SEPARATOR)
|
9
|
+
@env = env
|
10
|
+
@file = file
|
11
|
+
@separator = separator
|
12
|
+
end
|
13
|
+
|
14
|
+
def which(cmd)
|
15
|
+
exts = @env['PATHEXT'] ? @env['PATHEXT'].split(';') : ['']
|
16
|
+
@env['PATH'].split(@separator).each do |path|
|
17
|
+
exts.each do |ext|
|
18
|
+
exe = @file.join(path, "#{cmd}#{ext}")
|
19
|
+
return exe if @file.executable?(exe) && !@file.directory?(exe)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
nil
|
11
23
|
end
|
12
|
-
return nil
|
13
24
|
end
|
14
25
|
end
|
data/quality.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
s.summary = 'Code quality tools for Ruby'
|
31
31
|
|
32
32
|
s.add_runtime_dependency('activesupport')
|
33
|
-
s.add_runtime_dependency('source_finder', ['>=2.
|
33
|
+
s.add_runtime_dependency('source_finder', ['>=2.4.1'])
|
34
34
|
s.add_runtime_dependency('cane', ['>= 2.6'])
|
35
35
|
s.add_runtime_dependency('reek', ['>= 1.3.4'])
|
36
36
|
s.add_runtime_dependency('flog', ['>= 4.1.1'])
|
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: 19.2.
|
4
|
+
version: 19.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.4.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.4.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cane
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|