summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-04-09 18:51:38 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-04-09 18:51:38 -0700
commitb1cb0df3566bcd0832831e5317505d7034eba0ea (patch)
tree943811fc2ccc9353a34c332be2ae70676aa08cfa
parent3443d63a8d9a699c48b59a7d369e4c7036ef7d1e (diff)
downloadchef-lcg/resource-partials.tar.gz
use start_with?lcg/resource-partials
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-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