summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-05-08 17:03:26 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-05-08 17:03:26 -0700
commitbc7687e56763cedbd010cfd566aa2fc0c53bb194 (patch)
tree3d3e3eec51c847f23dc2955f9d058777bdea9a91 /lib/chef/mixin
parente793c825c857af87e745a8af479af71522ff20db (diff)
downloadchef-bc7687e56763cedbd010cfd566aa2fc0c53bb194.tar.gz
Convert require to require_relative
This gives a speed boost since rubygems does not have to scan through every gem in the gemset in order to find the file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/checksum.rb2
-rw-r--r--lib/chef/mixin/enforce_ownership_and_permissions.rb2
-rw-r--r--lib/chef/mixin/file_class.rb2
-rw-r--r--lib/chef/mixin/homebrew_user.rb2
-rw-r--r--lib/chef/mixin/params_validate.rb8
-rw-r--r--lib/chef/mixin/powershell_exec.rb2
-rw-r--r--lib/chef/mixin/powershell_out.rb4
-rw-r--r--lib/chef/mixin/properties.rb6
-rw-r--r--lib/chef/mixin/provides.rb2
-rw-r--r--lib/chef/mixin/shell_out.rb4
-rw-r--r--lib/chef/mixin/train_or_shell.rb6
-rw-r--r--lib/chef/mixin/which.rb2
-rw-r--r--lib/chef/mixin/windows_architecture_helper.rb4
-rw-r--r--lib/chef/mixin/windows_env_helper.rb6
-rw-r--r--lib/chef/mixin/xml_escape.rb2
15 files changed, 27 insertions, 27 deletions
diff --git a/lib/chef/mixin/checksum.rb b/lib/chef/mixin/checksum.rb
index 2888b205a9..74607da04b 100644
--- a/lib/chef/mixin/checksum.rb
+++ b/lib/chef/mixin/checksum.rb
@@ -17,7 +17,7 @@
#
require "digest/sha2"
-require "chef/digester"
+require_relative "../digester"
class Chef
module Mixin
diff --git a/lib/chef/mixin/enforce_ownership_and_permissions.rb b/lib/chef/mixin/enforce_ownership_and_permissions.rb
index e02c34748f..5e91c81ba6 100644
--- a/lib/chef/mixin/enforce_ownership_and_permissions.rb
+++ b/lib/chef/mixin/enforce_ownership_and_permissions.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require "chef/file_access_control"
+require_relative "../file_access_control"
class Chef
module Mixin
diff --git a/lib/chef/mixin/file_class.rb b/lib/chef/mixin/file_class.rb
index 166dd5796a..5c7e690db4 100644
--- a/lib/chef/mixin/file_class.rb
+++ b/lib/chef/mixin/file_class.rb
@@ -24,7 +24,7 @@ class Chef
def file_class
@host_os_file ||= if Chef::Platform.windows?
- require "chef/win32/file"
+ require_relative "../win32/file"
Chef::ReservedNames::Win32::File
else
::File
diff --git a/lib/chef/mixin/homebrew_user.rb b/lib/chef/mixin/homebrew_user.rb
index b038dfd3b7..9e619c3c47 100644
--- a/lib/chef/mixin/homebrew_user.rb
+++ b/lib/chef/mixin/homebrew_user.rb
@@ -22,7 +22,7 @@
# This lives here in Chef::Mixin because Chef's namespacing makes it
# awkward to use modules elsewhere (e.g., chef/provider/package/homebrew/owner)
-require "chef/mixin/shell_out"
+require_relative "shell_out"
require "etc"
class Chef
diff --git a/lib/chef/mixin/params_validate.rb b/lib/chef/mixin/params_validate.rb
index a71bec6958..0f18eb4f54 100644
--- a/lib/chef/mixin/params_validate.rb
+++ b/lib/chef/mixin/params_validate.rb
@@ -15,10 +15,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "chef/constants"
-require "chef/property"
-require "chef/delayed_evaluator"
-require "chef/exceptions"
+require_relative "../constants"
+require_relative "../property"
+require_relative "../delayed_evaluator"
+require_relative "../exceptions"
class Chef
module Mixin
diff --git a/lib/chef/mixin/powershell_exec.rb b/lib/chef/mixin/powershell_exec.rb
index cdd5450fa3..3e811511de 100644
--- a/lib/chef/mixin/powershell_exec.rb
+++ b/lib/chef/mixin/powershell_exec.rb
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "chef/powershell"
+require_relative "../powershell"
# The powershell_exec mixin provides in-process access to PowerShell engine via
# a COM interop (installed by the Chef Client installer).
diff --git a/lib/chef/mixin/powershell_out.rb b/lib/chef/mixin/powershell_out.rb
index f910360d36..3ef4cd84cc 100644
--- a/lib/chef/mixin/powershell_out.rb
+++ b/lib/chef/mixin/powershell_out.rb
@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "chef/mixin/shell_out"
-require "chef/mixin/windows_architecture_helper"
+require_relative "shell_out"
+require_relative "windows_architecture_helper"
class Chef
module Mixin
diff --git a/lib/chef/mixin/properties.rb b/lib/chef/mixin/properties.rb
index 3c61c88f55..03ee1d66cc 100644
--- a/lib/chef/mixin/properties.rb
+++ b/lib/chef/mixin/properties.rb
@@ -1,6 +1,6 @@
-require "chef/delayed_evaluator"
-require "chef/mixin/params_validate"
-require "chef/property"
+require_relative "../delayed_evaluator"
+require_relative "params_validate"
+require_relative "../property"
class Chef
module Mixin
diff --git a/lib/chef/mixin/provides.rb b/lib/chef/mixin/provides.rb
index ca045d019e..d088a72d5d 100644
--- a/lib/chef/mixin/provides.rb
+++ b/lib/chef/mixin/provides.rb
@@ -1,5 +1,5 @@
-require "chef/mixin/descendants_tracker"
+require_relative "descendants_tracker"
class Chef
module Mixin
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index a96bd1527f..a7272c0bf3 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -16,7 +16,7 @@
# limitations under the License.
require "mixlib/shellout"
-require "chef/mixin/path_sanity"
+require_relative "path_sanity"
class Chef
module Mixin
@@ -184,4 +184,4 @@ class Chef
end
# Break circular dep
-require "chef/config"
+require_relative "../config"
diff --git a/lib/chef/mixin/train_or_shell.rb b/lib/chef/mixin/train_or_shell.rb
index 6a47d52a1d..f1ea98547b 100644
--- a/lib/chef/mixin/train_or_shell.rb
+++ b/lib/chef/mixin/train_or_shell.rb
@@ -17,9 +17,9 @@
#
require "ostruct"
-require "chef/mixin/shell_out"
-require "chef/mixin/powershell_out"
-require "chef/config"
+require_relative "shell_out"
+require_relative "powershell_out"
+require_relative "../config"
class Chef
module Mixin
diff --git a/lib/chef/mixin/which.rb b/lib/chef/mixin/which.rb
index ffa324c911..e373a52521 100644
--- a/lib/chef/mixin/which.rb
+++ b/lib/chef/mixin/which.rb
@@ -18,7 +18,7 @@
class Chef
module Mixin
module Which
- require "chef/chef_class"
+ require_relative "../chef_class"
def which(*cmds, extra_path: nil, &block)
where(*cmds, extra_path: extra_path, &block).first || false
diff --git a/lib/chef/mixin/windows_architecture_helper.rb b/lib/chef/mixin/windows_architecture_helper.rb
index 67c34a85a1..18dfa2010a 100644
--- a/lib/chef/mixin/windows_architecture_helper.rb
+++ b/lib/chef/mixin/windows_architecture_helper.rb
@@ -16,8 +16,8 @@
# limitations under the License.
#
-require "chef/exceptions"
-require "chef/platform/query_helpers"
+require_relative "../exceptions"
+require_relative "../platform/query_helpers"
require "chef/win32/process" if Chef::Platform.windows?
require "chef/win32/system" if Chef::Platform.windows?
diff --git a/lib/chef/mixin/windows_env_helper.rb b/lib/chef/mixin/windows_env_helper.rb
index 610c0cd075..b8c11803fa 100644
--- a/lib/chef/mixin/windows_env_helper.rb
+++ b/lib/chef/mixin/windows_env_helper.rb
@@ -16,9 +16,9 @@
# limitations under the License.
#
-require "chef/exceptions"
-require "chef/mixin/wide_string"
-require "chef/platform/query_helpers"
+require_relative "../exceptions"
+require_relative "wide_string"
+require_relative "../platform/query_helpers"
require "chef/win32/error" if Chef::Platform.windows?
require "chef/win32/api/system" if Chef::Platform.windows?
require "chef/win32/api/unicode" if Chef::Platform.windows?
diff --git a/lib/chef/mixin/xml_escape.rb b/lib/chef/mixin/xml_escape.rb
index b591b09db0..1284a9779a 100644
--- a/lib/chef/mixin/xml_escape.rb
+++ b/lib/chef/mixin/xml_escape.rb
@@ -46,7 +46,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require "chef/log"
+require_relative "../log"
begin
require "fast_xs"