ruby-changes:65071
From: Kazuhiro <ko1@a...>
Date: Thu, 28 Jan 2021 18:03:46 +0900 (JST)
Subject: [ruby-changes:65071] 00bd645f09 (master): Delete path including `/../` too
https://git.ruby-lang.org/ruby.git/commit/?id=00bd645f09 From 00bd645f09ef96af55e4060deee7882a46d33206 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Thu, 28 Jan 2021 17:54:29 +0900 Subject: Delete path including `/../` too --- spec/bundler/support/matchers.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb index 01e11eb..3d926f5 100644 --- a/spec/bundler/support/matchers.rb +++ b/spec/bundler/support/matchers.rb @@ -123,7 +123,10 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/matchers.rb#L123 require_path = name == "bundler" ? "#{lib_dir}/bundler" : name.tr("-", "/") version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name) code = [] - code << "$LOAD_PATH.delete '#{exclude_from_load_path}'" if exclude_from_load_path + if exclude_from_load_path + code << "exclude_from_load_path = File.expand_path('#{exclude_from_load_path}')" + code << "$LOAD_PATH.delete_if { |path| File.expand_path(path) == exclude_from_load_path }" + end code << "require '#{require_path}.rb'" code << "puts #{version_const}" run code.join("; "), *groups -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/