From 17088a9c92e3eeef3c60e53fbb33a29acfac25b8 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 20 Dec 2019 16:34:35 -0800 Subject: Substitute require for require_relative require_relative is significantly faster and should be used when available. Signed-off-by: Tim Smith --- lib/wmi-lite.rb | 4 ++-- lib/wmi-lite/wmi.rb | 8 ++++---- lib/wmi-lite/wmi_exception.rb | 2 +- lib/wmi-lite/wmi_instance.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/wmi-lite.rb b/lib/wmi-lite.rb index 44375b3..2e89165 100644 --- a/lib/wmi-lite.rb +++ b/lib/wmi-lite.rb @@ -1,6 +1,6 @@ # # Author:: Adam Edwards () -# Copyright:: Copyright 2014 Chef Software, Inc. +# Copyright:: Copyright 2014-2019 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,4 +16,4 @@ # limitations under the License. # -require "wmi-lite/wmi" +require_relative 'wmi-lite/wmi' diff --git a/lib/wmi-lite/wmi.rb b/lib/wmi-lite/wmi.rb index 2f54825..3d4331b 100644 --- a/lib/wmi-lite/wmi.rb +++ b/lib/wmi-lite/wmi.rb @@ -1,6 +1,6 @@ # # Author:: Adam Edwards () -# Copyright:: Copyright 2014 Chef Software, Inc. +# Copyright:: Copyright 2014-2019 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,9 +16,9 @@ # limitations under the License. # -require "win32ole" if RUBY_PLATFORM =~ /mswin|mingw32|windows/ -require "wmi-lite/wmi_instance" -require "wmi-lite/wmi_exception" +require 'win32ole' if RUBY_PLATFORM =~ /mswin|mingw32|windows/ +require_relative 'wmi_instance' +require_relative 'wmi_exception' module WmiLite class Wmi diff --git a/lib/wmi-lite/wmi_exception.rb b/lib/wmi-lite/wmi_exception.rb index 7d97011..b950af3 100644 --- a/lib/wmi-lite/wmi_exception.rb +++ b/lib/wmi-lite/wmi_exception.rb @@ -1,6 +1,6 @@ # # Author:: Adam Edwards () -# Copyright:: Copyright 2014 Chef Software, Inc. +# Copyright:: Copyright 2014-2019 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/lib/wmi-lite/wmi_instance.rb b/lib/wmi-lite/wmi_instance.rb index 947b3fa..752982f 100644 --- a/lib/wmi-lite/wmi_instance.rb +++ b/lib/wmi-lite/wmi_instance.rb @@ -1,6 +1,6 @@ # # Author:: Adam Edwards () -# Copyright:: Copyright 2014 Chef Software, Inc. +# Copyright:: Copyright 2014-2019 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); -- cgit v1.2.1