quality 23.0.6 → 23.0.7

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: 4e908d1f4dbf3e8e735f172c059e91b52c9b2dfa
4
- data.tar.gz: 2708a2e56d199a5447bee69960c41dfba5941038
3
+ metadata.gz: e9bc167ba873b117fd6a68918b2d725e6ed690c7
4
+ data.tar.gz: b6449ddb9ef200f22ede802b4b725ef0599b1800
5
5
  SHA512:
6
- metadata.gz: 5cda27db2a3d141e0fd0fa321797079625509e292b8fe145e8b6f68f8c8064c90beb0278d2adb41ef8347208406729ac55d0377e49dcb9825cc94fa1d8b4f4cf
7
- data.tar.gz: 22ad729fdf5a3c1a34e208a9606377cf13b9d302c48ec077d9a753aee9afa9801ac5fc53919d3c36882d8e2ae0402faea584152472bc2e1a9fb80c26ff541cee
6
+ metadata.gz: fa41d35028970df19bd0a9ba63dd6f2bc2dd9cdeb3db366b14bee04783d8712a7ecb16854c0f2d55ff609405c3b303fbbc836e2bbd2fbe3df40e0c23766542ee
7
+ data.tar.gz: 814504792158be36626ff1ffd92d1fc0119a12f56505be93cf22d599d788a6e3a67e5a21c3735dbc89d4b4afd6b3b82c459f3e95516be44336ae02a9597ab3d0
@@ -11,12 +11,14 @@ module Quality
11
11
  commit: repo.head,
12
12
  project: Linguist::Repository.new(repo, commit.target_id),
13
13
  file_blob: Linguist::FileBlob,
14
+ file_class: File,
14
15
  pwd: Dir.pwd)
15
16
  @repo = repo
16
17
  @commit = commit
17
18
  @project = project
18
19
  @breakdown_by_file = @project.breakdown_by_file
19
20
  @file_blob = file_blob
21
+ @file_class = file_class
20
22
  @exclude_files = nil
21
23
  @pwd = pwd
22
24
  end
@@ -32,14 +34,21 @@ module Quality
32
34
  mode_format == 0o0160000
33
35
  end
34
36
 
37
+ def ok_to_process?(filename, file)
38
+ file[:type] == :blob &&
39
+ !submodule_or_symlink?(file) &&
40
+ @file_class.exist?(filename) &&
41
+ !@file_class.symlink?(filename) &&
42
+ @file_class.readable?(filename)
43
+ end
44
+
35
45
  def all_files
36
46
  @source_files ||= begin
37
47
  files = []
38
48
  tree = @commit.target.tree
39
49
  tree.walk(:preorder) do |root, file|
40
- unless file[:type] != :blob || submodule_or_symlink?(file)
41
- files << "#{root}#{file[:name]}"
42
- end
50
+ filename = "#{root}#{file[:name]}"
51
+ files << filename if ok_to_process?(filename, file)
43
52
  end
44
53
  files
45
54
  end
@@ -4,5 +4,5 @@
4
4
  # reek, flog, flay and rubocop and makes sure your numbers don't get
5
5
  # any worse over time.
6
6
  module Quality
7
- VERSION = '23.0.6'
7
+ VERSION = '23.0.7'
8
8
  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: 23.0.6
4
+ version: 23.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz