diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2026-05-07 20:32:26 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-05-07 12:00:14 +0000 |
| commit | b6e4fa71d514796ee826b1257bfd7b2a177f5f09 (patch) | |
| tree | 177c8aa2ad8244b42c3cbd7e0218267317c32dc7 | |
| parent | 58ae5ea7ee00c2f31a678574a7ccab28716cb4d0 (diff) | |
[ruby/rubygems] Use Pathname#absolute?
`Pathname::SEPARATOR_PAT` should be private, but was not set to
private just due to a typo.
https://github.com/ruby/rubygems/commit/67ce6df4c9
| -rw-r--r-- | lib/bundler/source/path.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 82e782ba25..366a23aea7 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -220,10 +220,11 @@ module Bundler # Some gem authors put absolute paths in their gemspec # and we have to save them from themselves spec.files = spec.files.filter_map do |path| - next path unless /\A#{Pathname::SEPARATOR_PAT}/o.match?(path) + pathname = Pathname.new(path) + next path unless pathname.absolute? next if File.directory?(path) begin - Pathname.new(path).relative_path_from(gem_dir).to_s + pathname.relative_path_from(gem_dir).to_s rescue ArgumentError path end |
