Skip to content

Commit 220c916

Browse files
committed
Switch core library search from $LOAD_PATH scan to RbConfig-based lookup
Changed the mechanism for collecting Ruby core libraries to search directories based on RbConfig::CONFIG instead of scanning the entire $LOAD_PATH.
1 parent 267cf92 commit 220c916

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ocran/direction.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ def construct(builder)
209209
# If requested, add all ruby standard libraries
210210
if @option.add_all_core?
211211
say "Will include all ruby core libraries"
212-
@pre_env.load_path.each do |load_path|
212+
RbConfig::CONFIG
213+
.slice("rubylibdir", "sitelibdir", "vendorlibdir")
214+
.values
215+
.each do |load_path|
213216
path = Pathname.new(load_path)
214217
# Match the load path against standard library, site_ruby, and vendor_ruby paths
215218
path.to_posix.match(RUBY_LIBRARY_PATH_REGEX) do |m|

0 commit comments

Comments
 (0)