summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/provider.rb4
-rw-r--r--lib/chef/resource.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 973d76325e..40bd5a48a1 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
-# Copyright:: Copyright 2008-2016, 2009-2020, Chef Software Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -91,7 +91,7 @@ class Chef
def self.use(partial)
dirname = ::File.dirname(partial)
basename = ::File.basename(partial, ".rb")
- basename = basename[1..-1] if basename[0] == "_"
+ basename = basename[1..-1] if basename.start_with?("_")
class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
end
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index d18d6ab158..fcf22a36b1 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -1471,7 +1471,7 @@ class Chef
def self.use(partial)
dirname = ::File.dirname(partial)
basename = ::File.basename(partial, ".rb")
- basename = basename[1..-1] if basename[0] == "_"
+ basename = basename[1..-1] if basename.start_with?("_")
class_eval IO.read(::File.expand_path("#{dirname}/_#{basename}.rb", ::File.dirname(caller_locations.first.absolute_path)))
end