source_finder 2.3.0 → 2.3.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: 597f615d9127ec7c1c45ab1c8abc60aabd28cfaf
4
- data.tar.gz: d6b7e2ef512b0ec25312d4b4234e676b99ee0cad
3
+ metadata.gz: 7740ce176ba916c9463e54dbe3bebaf477e1820d
4
+ data.tar.gz: fe78b2ab31a0fe5b6c104aa7c21f10877000f651
5
5
  SHA512:
6
- metadata.gz: ae7fb1405468632294149177be05585226f5feff2590ff7a98d35a9bfc438434344ce07069f5d07b0c4faa86ec47184a59d781445eec42e176d37525cb0947a9
7
- data.tar.gz: 840341e840517812426222f0e24fe7997212d6ccde264efede9515a6f1e2bdd07c4b4398457df080120070afbde2f56aa89c770f58f412575bae9206ef10b7df
6
+ metadata.gz: 9c37ed64bc7ae475d3fd167603033f0be654b2bc24ed9acc3fa85f6342c113d408f831c7b50f9f537d3854494f85561e40817b6985bd13be40c9183a1f2133ed
7
+ data.tar.gz: 865ec2ca12f31e842ca98f456fa579bf013d53d3184377688db3b84c609d53def28d6400bbfcf4f5a58bb64a12728758d7a45f4fc5ee476868eeee2e3b8d5a59
@@ -9,15 +9,11 @@ module SourceFinder
9
9
  # See README.md for documentation on these configuration parameters.
10
10
  attr_accessor :source_dirs_arr, :extra_source_files_arr,
11
11
  :source_file_extensions_arr, :source_files_glob,
12
- :source_files_exclude_glob,
13
- :source_file_extensions_glob
14
-
15
- attr_accessor :exclude_files_arr
12
+ :source_files_exclude_glob, :source_file_extensions_glob,
13
+ :exclude_files_arr
16
14
 
17
15
  include RubySourceFileGlobber
18
-
19
16
  include JsSourceFileGlobber
20
-
21
17
  include PythonSourceFileGlobber
22
18
 
23
19
  def initialize(globber: Dir)
@@ -31,9 +27,8 @@ module SourceFinder
31
27
 
32
28
  def extra_source_files_arr
33
29
  @extra_source_files_arr ||=
34
- (extra_ruby_files_arr +
35
- extra_js_files_arr +
36
- extra_python_files_arr).concat(%w(Dockerfile)).sort.uniq
30
+ (extra_ruby_files_arr + extra_js_files_arr + extra_python_files_arr)
31
+ .concat(%w(Dockerfile)).sort.uniq
37
32
  end
38
33
 
39
34
  def default_source_files_exclude_glob
@@ -51,10 +46,10 @@ module SourceFinder
51
46
  end
52
47
 
53
48
  def source_files_exclude_glob
54
- if @source_files_exclude_glob
55
- @source_files_exclude_glob
56
- elsif @exclude_files_arr
49
+ if @exclude_files_arr
57
50
  "{#{exclude_files_arr.join(',')}}"
51
+ elsif @source_files_exclude_glob
52
+ @source_files_exclude_glob
58
53
  else
59
54
  default_source_files_exclude_glob
60
55
  end
@@ -89,7 +84,7 @@ module SourceFinder
89
84
  @source_and_doc_file_extensions_glob
90
85
  elsif @source_file_extensions_glob
91
86
  @source_and_doc_file_extensions_glob ||=
92
- @source_file_extensions_glob + ',' + source_file_extensions_glob
87
+ @source_file_extensions_glob + ',' + doc_file_extensions_arr.join(',')
93
88
  else
94
89
  @source_and_doc_file_extensions_glob ||=
95
90
  source_and_doc_file_extensions_arr.join(',')
@@ -108,22 +103,15 @@ module SourceFinder
108
103
  end
109
104
 
110
105
  def arr2glob(arr)
111
- glob = ''
112
- glob += "#{arr.join(',')}," if arr.size > 0
113
- glob
106
+ arr.size > 0 ? "#{arr.join(',')}," : ''
114
107
  end
115
108
 
116
109
  def make_files_glob(extra_source_files_arr,
117
110
  dirs_arr,
118
111
  extensions_glob)
119
- glob = '{'
120
- glob += arr2glob(extra_source_files_arr)
121
- glob +=
122
- "{*,.*}.{#{extensions_glob}}," +
123
- File.join("{#{dirs_arr.join(',')}}",
124
- '**',
112
+ '{' + arr2glob(extra_source_files_arr) + "{*,.*}.{#{extensions_glob}}," +
113
+ File.join("{#{dirs_arr.join(',')}}", '**',
125
114
  "{*,.*}.{#{extensions_glob}}") + '}'
126
- glob
127
115
  end
128
116
 
129
117
  def emacs_lockfile?(filename)
@@ -131,8 +119,7 @@ module SourceFinder
131
119
  end
132
120
 
133
121
  def exclude_garbage(files_arr)
134
- files_arr.reject { |filename| emacs_lockfile?(filename) }
135
- .sort.uniq
122
+ files_arr.reject { |filename| emacs_lockfile?(filename) }.sort.uniq
136
123
  end
137
124
 
138
125
  def source_files_arr
@@ -1,4 +1,4 @@
1
1
  # SourceFinder finds source and documentation files within a project.
2
2
  module SourceFinder
3
- VERSION = '2.3.0'
3
+ VERSION = '2.3.1'
4
4
  end
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: 2.3.0
4
+ version: 2.3.1
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-12-27 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler