mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 14:34:39 +02:00
Delete path including /../
too
This commit is contained in:
parent
edaf0c250c
commit
00bd645f09
1 changed files with 4 additions and 1 deletions
|
@ -123,7 +123,10 @@ module Spec
|
||||||
require_path = name == "bundler" ? "#{lib_dir}/bundler" : name.tr("-", "/")
|
require_path = name == "bundler" ? "#{lib_dir}/bundler" : name.tr("-", "/")
|
||||||
version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name)
|
version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name)
|
||||||
code = []
|
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 << "require '#{require_path}.rb'"
|
||||||
code << "puts #{version_const}"
|
code << "puts #{version_const}"
|
||||||
run code.join("; "), *groups
|
run code.join("; "), *groups
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue