From d345e84f6b2cf78500298f3bca24f03420a28b16 Mon Sep 17 00:00:00 2001 From: Paul Cantrell Date: Tue, 16 Aug 2016 23:59:27 -0500 Subject: [PATCH 1/4] Fixed wildcards in exclude --- lib/jazzy/config.rb | 2 +- lib/jazzy/sourcekitten.rb | 2 +- spec/integration_specs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb index 22b9fec49..567b78d59 100644 --- a/lib/jazzy/config.rb +++ b/lib/jazzy/config.rb @@ -154,7 +154,7 @@ def expand_path(path) description: 'Files/directories to be excluded from documentation', default: [], parse: ->(files) do - Array(files).map { |f| expand_path(f) } + Array(files).map { |f| expand_path(f).to_s } end config_attr :swift_version, diff --git a/lib/jazzy/sourcekitten.rb b/lib/jazzy/sourcekitten.rb index 4136d780e..329f5a88c 100644 --- a/lib/jazzy/sourcekitten.rb +++ b/lib/jazzy/sourcekitten.rb @@ -417,7 +417,7 @@ def self.filter_excluded_files(json) excluded_files = Config.instance.excluded_files json.map do |doc| key = doc.keys.first - doc[key] unless excluded_files.detect { |f| File.fnmatch?(key, f) } + doc[key] unless excluded_files.detect { |exclude| File.fnmatch?(exclude, key) } end.compact end diff --git a/spec/integration_specs b/spec/integration_specs index c2da9179a..570dc142c 160000 --- a/spec/integration_specs +++ b/spec/integration_specs @@ -1 +1 @@ -Subproject commit c2da9179ab6bb74f724e277d57ea78fd4cb823e6 +Subproject commit 570dc142cff5170572554bde320d08e4d6a709e5 From 39fa4b9f4fb4b604e583a29f135f6d70571039a3 Mon Sep 17 00:00:00 2001 From: Paul Cantrell Date: Wed, 17 Aug 2016 00:10:20 -0500 Subject: [PATCH 2/4] Updated help to indicate that exclude supports wildcards --- lib/jazzy/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb index 567b78d59..2cb45f58f 100644 --- a/lib/jazzy/config.rb +++ b/lib/jazzy/config.rb @@ -151,7 +151,7 @@ def expand_path(path) config_attr :excluded_files, command_line: ['-e', '--exclude file1,file2,directory3,…fileN', Array], - description: 'Files/directories to be excluded from documentation', + description: 'Files/directories to be excluded from documentation. Supports wildcards.', default: [], parse: ->(files) do Array(files).map { |f| expand_path(f).to_s } From 25399271aee940407d308fc5109c3c4259e86b25 Mon Sep 17 00:00:00 2001 From: Paul Cantrell Date: Wed, 17 Aug 2016 00:10:00 -0500 Subject: [PATCH 3/4] Changelog entry for exclude wildcards --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 179b59653..3aa0dc674 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ [Paul Cantrell](https://github.com/pcantrell) [#598](https://github.com/realm/jazzy/issues/598) +* The `exclude` option now properly supports wildcards. + [Paul Cantrell](https://github.com/pcantrell) + [#640](https://github.com/realm/jazzy/issues/640) + ## 0.7.0 ##### Breaking From a0bffb255479758c668be41d4be4135aaeb08a79 Mon Sep 17 00:00:00 2001 From: Paul Cantrell Date: Wed, 17 Aug 2016 00:47:00 -0500 Subject: [PATCH 4/4] Line breaks for rubocop --- lib/jazzy/config.rb | 3 ++- lib/jazzy/sourcekitten.rb | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb index 2cb45f58f..3f974d4a4 100644 --- a/lib/jazzy/config.rb +++ b/lib/jazzy/config.rb @@ -151,7 +151,8 @@ def expand_path(path) config_attr :excluded_files, command_line: ['-e', '--exclude file1,file2,directory3,…fileN', Array], - description: 'Files/directories to be excluded from documentation. Supports wildcards.', + description: 'Files/directories to be excluded from documentation. '\ + 'Supports wildcards.', default: [], parse: ->(files) do Array(files).map { |f| expand_path(f).to_s } diff --git a/lib/jazzy/sourcekitten.rb b/lib/jazzy/sourcekitten.rb index 329f5a88c..e8d1d4172 100644 --- a/lib/jazzy/sourcekitten.rb +++ b/lib/jazzy/sourcekitten.rb @@ -417,7 +417,9 @@ def self.filter_excluded_files(json) excluded_files = Config.instance.excluded_files json.map do |doc| key = doc.keys.first - doc[key] unless excluded_files.detect { |exclude| File.fnmatch?(exclude, key) } + doc[key] unless excluded_files.detect do |exclude| + File.fnmatch?(exclude, key) + end end.compact end