source_finder 2.3.2 → 2.4.0

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: b6ecbf7965c9e0af5116ffb6c7bd0b1bf012ffaf
4
- data.tar.gz: 3359716864ec2918c0c6c72d09e64325f41210f9
3
+ metadata.gz: d3bd7e1099d630f8438986e471408ce11b86678a
4
+ data.tar.gz: 7cf482806ad50d8aa7d18553be6ecccd2b7a5134
5
5
  SHA512:
6
- metadata.gz: b7bdda00f84530f105bf3dc078aa1fe5174ba75d68af5d56074ccd2156b8e734ac57b60e233195bbf6ddd007044afd4ec27d95591a89653ac7e344c542dc0f8b
7
- data.tar.gz: d9fc5f1c2628692c462b3e70af1faa86b2ae66a4c49f0d80d3d4d92055a755c9237ea1930ab1f0bab25bcf92e1804b7877d7d5e710f7f7b9e58a1224a4d14605
6
+ metadata.gz: 2aec66197c7a0d2d5985ef92d4ad43c28542580718bd9c2428611bc484f5aea9800cd791cae09fd7c6b6b25c7413d658174f7efd0717bd8cb556aed342690e17
7
+ data.tar.gz: e42acce8c250f4e054ea82d3d8cd2862dec1fae92d813987a0fcd72a2d94632c1364d7cc2364e6350582e809bef93f55a7e1bc0ce8e1ac8f386e0ee1436769fc
@@ -13,7 +13,9 @@ module SourceFinder
13
13
  end
14
14
 
15
15
  def js_file_extensions_arr
16
- @js_file_extensions_arr || %w(js)
16
+ make_extensions_arr(@js_file_extensions_glob,
17
+ @js_file_extensions_arr,
18
+ %w(js))
17
19
  end
18
20
 
19
21
  def js_file_extensions_glob
@@ -13,7 +13,9 @@ module SourceFinder
13
13
  end
14
14
 
15
15
  def python_file_extensions_arr
16
- @python_file_extensions_arr || %w(py)
16
+ make_extensions_arr(@python_file_extensions_glob,
17
+ @python_file_extensions_arr,
18
+ %w(py))
17
19
  end
18
20
 
19
21
  def python_file_extensions_glob
@@ -2,6 +2,7 @@ module SourceFinder
2
2
  # Globber for Ruby
3
3
  module RubySourceFileGlobber
4
4
  attr_accessor :ruby_dirs_arr, :extra_ruby_files_arr,
5
+ :ruby_file_extensions_glob,
5
6
  :ruby_file_extensions_arr
6
7
 
7
8
  def ruby_dirs_arr
@@ -13,11 +14,13 @@ module SourceFinder
13
14
  end
14
15
 
15
16
  def ruby_file_extensions_arr
16
- @ruby_file_extensions_arr || %w(gemspec rake rb)
17
+ make_extensions_arr(@ruby_file_extensions_glob,
18
+ @ruby_file_extensions_arr,
19
+ %w(gemspec rake rb))
17
20
  end
18
21
 
19
22
  def ruby_file_extensions_glob
20
- @ruby_file_extensions_glob ||= ruby_file_extensions_arr.join(',')
23
+ @ruby_file_extensions_glob || ruby_file_extensions_arr.join(',')
21
24
  end
22
25
 
23
26
  def ruby_files_glob
@@ -36,9 +36,8 @@ module SourceFinder
36
36
  end
37
37
 
38
38
  def exclude_files_arr
39
- if @exclude_files_arr
40
- @exclude_files_arr
41
- elsif @source_files_exclude_glob
39
+ return @exclude_files_arr if @exclude_files_arr
40
+ if @source_files_exclude_glob
42
41
  exclude_garbage(@globber.glob(@source_files_exclude_glob))
43
42
  else
44
43
  exclude_garbage(@globber.glob(default_source_files_exclude_glob))
@@ -106,14 +105,17 @@ module SourceFinder
106
105
  arr.size > 0 ? "#{arr.join(',')}," : ''
107
106
  end
108
107
 
109
- def make_files_glob(extra_source_files_arr,
110
- dirs_arr,
111
- extensions_glob)
108
+ def make_files_glob(extra_source_files_arr, dirs_arr, extensions_glob)
112
109
  '{' + arr2glob(extra_source_files_arr) + "{*,.*}.{#{extensions_glob}}," +
113
110
  File.join("{#{dirs_arr.join(',')}}", '**',
114
111
  "{*,.*}.{#{extensions_glob}}") + '}'
115
112
  end
116
113
 
114
+ def make_extensions_arr(glob_var, arr_var, default_arr)
115
+ fail 'glob already set' if glob_var
116
+ arr_var || default_arr
117
+ end
118
+
117
119
  def emacs_lockfile?(filename)
118
120
  File.basename(filename) =~ /^\.#/
119
121
  end
@@ -1,4 +1,4 @@
1
1
  # SourceFinder finds source and documentation files within a project.
2
2
  module SourceFinder
3
- VERSION = '2.3.2'
3
+ VERSION = '2.4.0'
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.2
4
+ version: 2.4.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-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: bundler