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 9e9d28e commit f4c028d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/chef-vault
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

require "optparse"
require "optparse" unless defined?(OptionParser)

options_config = {
chef: {
Expand Down Expand Up @@ -82,7 +82,7 @@ options_config.each do |option, config|
options[option] = options[option] ? options[option] : config[:default]
end

require "rubygems"
require "rubygems" unless defined?(Gem)
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "chef-vault"

Expand Down

0 comments on commit f4c028d

Please sign in to comment.