diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-01-28 18:23:13 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2021-01-28 18:23:13 +0900 |
commit | 1b377b32c8616f85c0a97e68758c5c2db83f2169 (patch) | |
tree | c0d5c045f0c981895024ab2d5ef00829ccfef42c /spec/bundler/runtime/setup_spec.rb | |
parent | 763d242fcdb2cd400a8973d7d0da3e162fee90d6 (diff) | |
download | ruby-1b377b32c8616f85c0a97e68758c5c2db83f2169.tar.gz |
Add fallback when PWD is not set
Diffstat (limited to 'spec/bundler/runtime/setup_spec.rb')
-rw-r--r-- | spec/bundler/runtime/setup_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/bundler/runtime/setup_spec.rb b/spec/bundler/runtime/setup_spec.rb index 09430d6a8c..e2bed00a7f 100644 --- a/spec/bundler/runtime/setup_spec.rb +++ b/spec/bundler/runtime/setup_spec.rb @@ -1340,8 +1340,12 @@ end # override the default gem. def load_path_exclusions_hack_for(name) if ruby_core? - # .ext/common is relative from build directory - ext_folder = Pathname(ENV["PWD"]) + ".ext/common" + if ENV.key?("PWD") + # .ext/common is relative from build directory + ext_folder = Pathname(ENV["PWD"]) + ".ext/common" + else + ext_folder = source_root.join(".ext/common") + end require_name = name.tr("-", "/") if File.exist?(ext_folder.join("#{require_name}.rb")) { :exclude_from_load_path => ext_folder.to_s } |