summaryrefslogtreecommitdiff
path: root/lib/chef/provider.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2022-03-21 14:19:14 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2022-03-21 14:19:14 -0700
commitbf996fa813d4bb781c4171a29caa3b2c721994f5 (patch)
treeb2e0a3bc8b8e5b00c941b70a7b2074c808346073 /lib/chef/provider.rb
parent64871f29aa638b9c52e33aaccb047e3bea5e8c80 (diff)
downloadchef-bf996fa813d4bb781c4171a29caa3b2c721994f5.tar.gz
Ruby 3.1 fixes
caller_location.first.absolute_path returns nil sometimes on ruby 3.1 switch to .path which is going to always be an absolute path anyway, but which ruby 3.1 doesn't return nil for. i have no idea why. smells like a ruby language bug. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider.rb')
-rw-r--r--lib/chef/provider.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 5fda36ac63..cf5c5c983e 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -113,7 +113,7 @@ class Chef
dirname = ::File.dirname(partial)
basename = ::File.basename(partial, ".rb")
basename = basename[1..] if basename.start_with?("_")
- class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
+ class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.path)))
end
# delegate to the resource