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 diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb index 22b9fec49..3f974d4a4 100644 --- a/lib/jazzy/config.rb +++ b/lib/jazzy/config.rb @@ -151,10 +151,11 @@ 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) } + 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..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 { |f| File.fnmatch?(key, f) } + doc[key] unless excluded_files.detect do |exclude| + File.fnmatch?(exclude, key) + end 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