source_finder 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/coverage/.last_run.json +5 -1
- data/lib/source_finder/source_file_globber.rb +74 -39
- data/lib/source_finder/version.rb +1 -1
- data/lib/source_finder.rb +2 -1
- data/metrics/bigfiles_high_water_mark +1 -1
- data/metrics/punchlist_high_water_mark +1 -1
- data/metrics/rubocop_high_water_mark +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 851c2a4ec6bd2ead4c9e7a5ad526155bdb555585
|
4
|
+
data.tar.gz: a6f8aa0f029cd970c586382def9c3b7f7c97bfae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 824b0ff4e7e1665578954d55f8de7d8b92d1f7f4ba2b1787226d07c044d640cc0afbef8481ba4b1aaf5b31bdd968d486b85ee5f07a90696d0ca7a2870c8cc3cb
|
7
|
+
data.tar.gz: 7a223cb12ad06a993c3e930a434541957814634c467f77fe429b30de3bb0eb2d65ba249e08d0aa54d0c1b69928da7a7fc96778743f2c1db7e0ddeef1acd16486
|
data/.rubocop.yml
CHANGED
data/coverage/.last_run.json
CHANGED
@@ -4,75 +4,110 @@ module SourceFinder
|
|
4
4
|
class SourceFileGlobber
|
5
5
|
# See README.md for documentation on these configuration parameters.
|
6
6
|
|
7
|
-
attr_accessor :
|
8
|
-
:
|
9
|
-
:
|
7
|
+
attr_accessor :ruby_dirs_arr, :source_dirs_arr, :extra_source_files_arr,
|
8
|
+
:extra_ruby_files_arr, :ruby_file_extensions_arr,
|
9
|
+
:source_file_extensions_arr, :exclude_files_arr,
|
10
|
+
:source_files_glob, :source_files_exclude_glob
|
10
11
|
|
11
|
-
def
|
12
|
-
@
|
12
|
+
def initialize(globber: Dir)
|
13
|
+
@globber = globber
|
13
14
|
end
|
14
15
|
|
15
|
-
def
|
16
|
-
@
|
16
|
+
def ruby_dirs_arr
|
17
|
+
@ruby_dirs_arr ||= %w(src app lib test spec feature)
|
17
18
|
end
|
18
19
|
|
19
|
-
def
|
20
|
-
@
|
20
|
+
def source_dirs_arr
|
21
|
+
@source_dirs_arr ||= ruby_dirs_arr.clone
|
21
22
|
end
|
22
23
|
|
23
|
-
def
|
24
|
-
@
|
24
|
+
def extra_source_files_arr
|
25
|
+
@extra_source_files_arr ||=
|
26
|
+
extra_ruby_files_arr.clone.concat(%w(Dockerfile))
|
25
27
|
end
|
26
28
|
|
27
|
-
def
|
29
|
+
def extra_ruby_files_arr
|
30
|
+
@extra_ruby_files_arr ||= %w(Rakefile)
|
31
|
+
end
|
32
|
+
|
33
|
+
def exclude_files_arr
|
28
34
|
if @source_files_exclude_glob
|
29
35
|
@globber.glob(@source_files_exclude_glob)
|
30
36
|
else
|
31
|
-
(@
|
37
|
+
(@exclude_files_arr || [])
|
32
38
|
end
|
33
39
|
end
|
34
40
|
|
35
|
-
def
|
36
|
-
@
|
37
|
-
|
38
|
-
|
41
|
+
def source_file_extensions_arr
|
42
|
+
@source_file_extensions_arr ||= ruby_file_extensions_arr +
|
43
|
+
%w(swift cpp c java py clj cljs scala js
|
44
|
+
yml sh json)
|
45
|
+
end
|
46
|
+
|
47
|
+
def doc_file_extensions_arr
|
48
|
+
@doc_file_extensions_arr ||= %w(md)
|
49
|
+
end
|
50
|
+
|
51
|
+
def source_file_extensions_glob
|
52
|
+
@source_file_extensions_glob ||= source_file_extensions_arr.join(',')
|
53
|
+
end
|
54
|
+
|
55
|
+
def source_and_doc_file_extensions_arr
|
56
|
+
doc_file_extensions_arr + source_file_extensions_arr
|
39
57
|
end
|
40
58
|
|
41
|
-
def
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
59
|
+
def source_and_doc_file_extensions_glob
|
60
|
+
@source_and_doc_file_extensions_glob ||=
|
61
|
+
source_and_doc_file_extensions_arr.join(',')
|
62
|
+
end
|
63
|
+
|
64
|
+
def source_files_glob
|
65
|
+
@source_files_glob || make_source_files_glob(extra_source_files_arr,
|
66
|
+
source_dirs_arr,
|
67
|
+
source_file_extensions_glob)
|
68
|
+
end
|
69
|
+
|
70
|
+
def source_and_doc_files_glob
|
71
|
+
make_source_files_glob(extra_source_files_arr,
|
72
|
+
source_dirs_arr,
|
73
|
+
source_and_doc_file_extensions_glob)
|
74
|
+
end
|
75
|
+
|
76
|
+
def make_source_files_glob(extra_source_files_arr,
|
77
|
+
dirs_arr,
|
78
|
+
extensions_glob)
|
79
|
+
"{#{extra_source_files_arr.join(',')}," \
|
80
|
+
"{*,.*}.{#{extensions_glob}}," +
|
81
|
+
File.join("{#{dirs_arr.join(',')}}",
|
82
|
+
'**',
|
83
|
+
"{*,.*}.{#{extensions_glob}}") +
|
84
|
+
'}'
|
51
85
|
end
|
52
86
|
|
53
87
|
def source_files_exclude_glob
|
54
|
-
@source_files_exclude_glob ||
|
55
|
-
"{#{exclude_files.join(', ')}}"
|
88
|
+
@source_files_exclude_glob || "{#{exclude_files_arr.join(', ')}}"
|
56
89
|
end
|
57
90
|
|
58
|
-
def
|
59
|
-
@
|
91
|
+
def ruby_file_extensions_arr
|
92
|
+
@ruby_file_extensions_arr || %w(rb rake gemspec)
|
60
93
|
end
|
61
94
|
|
62
|
-
def
|
63
|
-
|
95
|
+
def ruby_file_extensions_glob
|
96
|
+
@ruby_file_extensions_glob ||= ruby_file_extensions_arr.join(',')
|
64
97
|
end
|
65
98
|
|
66
|
-
def
|
67
|
-
|
99
|
+
def ruby_files_glob
|
100
|
+
make_source_files_glob(extra_ruby_files_arr,
|
101
|
+
ruby_dirs_arr,
|
102
|
+
ruby_file_extensions_glob)
|
68
103
|
end
|
69
104
|
|
70
|
-
def
|
71
|
-
@globber.glob(
|
105
|
+
def ruby_files_arr
|
106
|
+
@globber.glob(ruby_files_glob) - exclude_files_arr
|
72
107
|
end
|
73
108
|
|
74
|
-
def
|
75
|
-
@globber
|
109
|
+
def source_files_arr
|
110
|
+
@globber.glob(source_files_glob) - exclude_files_arr
|
76
111
|
end
|
77
112
|
end
|
78
113
|
end
|
data/lib/source_finder.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
278
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
0
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: source_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|