source_finder 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e0d0f568a71b7217644b6ff017fffe4018aa25d
4
- data.tar.gz: 648cd95098a5c1395011fd05bd4bb79acc2bac7e
3
+ metadata.gz: 1089d8af1edd6c5321df1664cf53c1f4c5c8a9e6
4
+ data.tar.gz: 7b3affae47870a707a5824bb56814c1fde4d2fa3
5
5
  SHA512:
6
- metadata.gz: 5938d4d656616ba863955212c1f8f2c307198d81e6299408983a4f52e9000d1db3ea3c5184782f12654a8cfd6c6a433c71d685dd8d4a6041d6237526d786148a
7
- data.tar.gz: 491deed20028116610efc849a95ddc2628f314b08feaf8480270fc532959a7d4e6478da481c1a82ec0e71129f25e8f7f64527c3f0632ce6d0784fd2b77641bae
6
+ metadata.gz: 43a3acf80e9f96a8e06fafa690b539dd45cc667416cd380cb2cc8b377fbef6d858b0b5131a257af5cc8ec9f80272f02389d54d14c498e1ac24c1a91971078d71
7
+ data.tar.gz: 497e4661e3a7030ad272877dd0bf9b3a57c98aafab2270d67ab575eb5b7b788291ab3b83a2afa2db900f04d8736418dcc0ee1f5683a57a7261b89e25395e9abe
@@ -0,0 +1,38 @@
1
+ module SourceFinder
2
+ # Brings in command-line options to configure SourceFinder--usable
3
+ # with the ruby OptionParser class, brought in with 'require
4
+ # "optparse"'
5
+ class OptionParser
6
+ def fresh_globber
7
+ SourceFinder::SourceFileGlobber.new
8
+ end
9
+
10
+ def default_source_files_glob
11
+ fresh_globber.source_files_glob
12
+ end
13
+
14
+ def default_source_files_exclude_glob
15
+ fresh_globber.source_files_exclude_glob
16
+ end
17
+
18
+ def add_glob_option(opts, options)
19
+ opts.on('-g glob here', '--glob',
20
+ 'Which files to parse - ' \
21
+ "default is #{default_source_files_glob}") do |v|
22
+ options[:glob] = v
23
+ end
24
+ end
25
+
26
+ def add_exclude_glob_option(opts, options)
27
+ opts.on('-e glob here', '--exclude-glob',
28
+ 'Files to exclude - default is none') do |v|
29
+ options[:exclude] = v
30
+ end
31
+ end
32
+
33
+ def add_options(opts, options)
34
+ add_glob_option(opts, options)
35
+ add_exclude_glob_option(opts, options)
36
+ end
37
+ end
38
+ end
@@ -28,7 +28,7 @@ module SourceFinder
28
28
  if @source_files_exclude_glob
29
29
  @globber.glob(@source_files_exclude_glob)
30
30
  else
31
- @exclude_files
31
+ (@exclude_files || [])
32
32
  end
33
33
  end
34
34
 
@@ -1,4 +1,4 @@
1
1
  # SourceFinder finds source and documentation files within a project.
2
2
  module SourceFinder
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz
@@ -101,6 +101,7 @@ files:
101
101
  - circle.yml
102
102
  - coverage/.last_run.json
103
103
  - lib/source_finder.rb
104
+ - lib/source_finder/option_parser.rb
104
105
  - lib/source_finder/source_file_globber.rb
105
106
  - lib/source_finder/version.rb
106
107
  - lib/tasks/ci.rake