Skip to content

Commit

Permalink
Merge pull request #969 from realm/jf-glob-expansion
Browse files Browse the repository at this point in the history
Do not unintentionally expand glob parameters
  • Loading branch information
johnfairh authored May 11, 2018
2 parents 54fc957 + d68ad95 commit 987a6d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/jazzy/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ class << self

attr_accessor :base_path

def expand_glob_path(path)
Pathname(path).expand_path(base_path) # nil means Pathname.pwd
end

def expand_path(path)
abs_path = Pathname(path).expand_path(base_path) # nil means Pathname.pwd
abs_path = expand_glob_path(path)
Pathname(Dir[abs_path][0] || abs_path) # Use existing filesystem spelling
end

Expand Down Expand Up @@ -165,7 +169,7 @@ def expand_path(path)
'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,
Expand All @@ -174,7 +178,7 @@ def expand_path(path)
'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,
Expand Down

0 comments on commit 987a6d8

Please sign in to comment.