Skip to content

Commit 67ce6df

Browse files
nobuhsbt
authored andcommitted
Use Pathname#absolute?
`Pathname::SEPARATOR_PAT` should be private, but was not set to private just due to a typo.
1 parent a4f8f38 commit 67ce6df

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

bundler/lib/bundler/source/path.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,11 @@ def generate_bin(spec, options = {})
220220
# Some gem authors put absolute paths in their gemspec
221221
# and we have to save them from themselves
222222
spec.files = spec.files.filter_map do |path|
223-
next path unless /\A#{Pathname::SEPARATOR_PAT}/o.match?(path)
223+
pathname = Pathname.new(path)
224+
next path unless pathname.absolute?
224225
next if File.directory?(path)
225226
begin
226-
Pathname.new(path).relative_path_from(gem_dir).to_s
227+
pathname.relative_path_from(gem_dir).to_s
227228
rescue ArgumentError
228229
path
229230
end

0 commit comments

Comments
 (0)