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 <tsmith@chef.io>
  • Loading branch information
tas50 committed Aug 20, 2020
1 parent eb874ce commit 15ea707
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rescue LoadError
end

begin
require "yard"
require "yard" unless defined?(YARD)
YARD::Rake::YardocTask.new(:docs)
rescue LoadError
puts "yard is not available. bundle install first to make sure all dependencies are installed."
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/cloud/google_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
require "chef/knife/cloud/helpers"
require_relative "google_service_helpers"
require "google/apis/compute_v1"
require "ipaddr"
require "ipaddr" unless defined?(IPAddr)
require_relative "../../../knife-google/version"

class Chef::Knife::Cloud
Expand Down

0 comments on commit 15ea707

Please sign in to comment.