Skip to content

Commit

Permalink
Add debug output to try_load
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Oct 22, 2024
1 parent 57855d7 commit a4380ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/mspec/lib/mspec/utils/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def config
# possibly appending +config[:config_ext]. Returns +false+
# otherwise.
def try_load(target)
puts "======= try_load"
names = [target]
unless target[-6..-1] == config[:config_ext]
names << target + config[:config_ext]
Expand All @@ -85,9 +86,12 @@ def try_load(target)
names.each do |name|
config[:path].each do |dir|
file = File.expand_path name, dir
puts " Trying to load `#{file}`"
if @loaded.include?(file)
puts " LOADED!"
return true
elsif File.exist? file
puts " EXISTS!"
value = Kernel.load(file)
@loaded << file
return value
Expand Down

0 comments on commit a4380ad

Please sign in to comment.