Skip to content

Commit

Permalink
Optimize our requires
Browse files Browse the repository at this point in the history
Avoid requiring things that are already defined. Rubygems is very slow at traversing the filesystem.

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Aug 20, 2020
1 parent a8dad92 commit 86c4c66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/kitchen/provisioner/habitat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Licensed under the MIT License.
# See LICENSE for more details

require "fileutils"
require "pathname"
require "fileutils" unless defined?(FileUtils)
require "pathname" unless defined?(Pathname)
require "kitchen/provisioner/base"
require "kitchen/util"

Expand Down
2 changes: 1 addition & 1 deletion spec/kitchen/provisioner/habitat_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative "../../spec_helper"

require "logger"
require "stringio"
require "stringio" unless defined?(StringIO)

require "kitchen/configurable"
require "kitchen/logging"
Expand Down

0 comments on commit 86c4c66

Please sign in to comment.