mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add fallback when PWD is not set
This commit is contained in:
parent
763d242fcd
commit
1b377b32c8
1 changed files with 6 additions and 2 deletions
|
@ -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 }
|
||||
|
|
Loading…
Add table
Reference in a new issue