quality 19.2.0 → 19.2.1

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: e47bb64085ada30d3be31d1b91adb07ed0aa0e51
4
- data.tar.gz: a79808375530728002c8a21dbf02e3a10dd490a0
3
+ metadata.gz: 2419ec7a0304aabcffc4d406dbdb2d39b84ad6a6
4
+ data.tar.gz: 5e83cfabae5da03934da1e76376cc577c8b7cb27
5
5
  SHA512:
6
- metadata.gz: 96202c7579ed13d6c268e302ebdcd20bde306eebc2fdc8b8859a5cdbedbf39a1739d280f72d9e9f1d290b199f6084fc53558ddff5917406e8188db10aaa50ae8
7
- data.tar.gz: 0dd376eae767ecd3978dfaa91b15512e05d697beb975d76e42f749b05d75a01ea9d3c023b4e7f762e3e175616577d0ddd2cafd4e816ed5a0478abf89b069b9b3
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 { |t|
60
+ Quality::Rake::Task.new do |t|
61
61
  # Name of quality task.
62
62
  # Defaults to :quality.
63
- t.quality_name = "quality"
63
+ t.quality_name = 'quality'
64
64
 
65
65
  # Name of ratchet task.
66
66
  # Defaults to :ratchet.
67
- t.ratchet_name = "ratchet"
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 *.rb in the base directory, as well as those directories.
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 analyze.
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', 'lib/vendor/someone_else_fault.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 = "{lib/whatever/imported_file.rb,lib/vendor/**/*.rb}"
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
@@ -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 ' + js_files_arr.join(' ')
15
+ 'jscs --auto-configure representative_file.js'
16
16
  0
17
17
  end
18
18
 
@@ -11,7 +11,8 @@ module Quality
11
11
  def quality_pep8
12
12
  ratchet_quality_cmd('pep8',
13
13
  args: pep8_args,
14
- gives_error_code_on_no_relevant_code: true) do |line|
14
+ gives_error_code_on_no_relevant_code:
15
+ true) do |line|
15
16
  line.split(':')[0].to_i
16
17
  end
17
18
  end
@@ -25,6 +25,9 @@ module Quality
25
25
  def count_rubocop_violations(line)
26
26
  if line =~ /^.* file[s|] inspected, (.*) offence[s|] detected$/
27
27
  0
28
+ elsif line =~ /^warning: .*/
29
+ # don't count internal rubocop errors/warnings
30
+ 0
28
31
  else
29
32
  1
30
33
  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 = '19.2.0'
5
+ VERSION = '19.2.1'
6
6
  end
@@ -1,14 +1,25 @@
1
- class Which
2
- # http://stackoverflow.com/questions/2108727/
3
- # which-in-ruby-checking-if-program-exists-in-path-from-ruby
4
- def which(cmd)
5
- exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
6
- ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
7
- exts.each { |ext|
8
- exe = File.join(path, "#{cmd}#{ext}")
9
- return exe if File.executable?(exe) && !File.directory?(exe)
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
@@ -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.3.0'])
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.0
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: 2015-12-29 00:00:00.000000000 Z
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.3.0
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.3.0
40
+ version: 2.4.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cane
43
43
  requirement: !ruby/object:Gem::Requirement