lib/jazzy/config.rb in jazzy-0.9.3 vs lib/jazzy/config.rb in jazzy-0.9.4
- old
+ new
@@ -84,14 +84,19 @@
attr_reader :all_config_attrs
end
attr_accessor :base_path
- def expand_path(path)
+ def expand_glob_path(path)
Pathname(path).expand_path(base_path) # nil means Pathname.pwd
end
+ def expand_path(path)
+ abs_path = expand_glob_path(path)
+ Pathname(Dir[abs_path][0] || abs_path) # Use existing filesystem spelling
+ end
+
# ──────── Build ────────
# rubocop:disable Layout/AlignParameters
config_attr :output,
@@ -162,19 +167,19 @@
command_line: ['-e', '--exclude filepath1,filepath2,…filepathN', Array],
description: 'Source file pathnames to be excluded from documentation. '\
'Supports wildcards.',
default: [],
parse: ->(files) do
- Array(files).map { |f| expand_path(f).to_s }
+ Array(files).map { |f| expand_glob_path(f).to_s }
end
config_attr :included_files,
command_line: ['-i', '--include filepath1,filepath2,…filepathN', Array],
description: 'Source file pathnames to be included in documentation. '\
'Supports wildcards.',
default: [],
parse: ->(files) do
- Array(files).map { |f| expand_path(f).to_s }
+ Array(files).map { |f| expand_glob_path(f).to_s }
end
config_attr :swift_version,
command_line: '--swift-version VERSION',
default: nil,