summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/policy_groups_endpoint.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-12 14:16:39 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-12 14:24:06 -0700
commit7e2d8e6a1b23cf459becfaaf0525a930bb2bd9e3 (patch)
tree60636cf607d266498c3424fa3e24a1ce06ef7a97 /lib/chef_zero/endpoints/policy_groups_endpoint.rb
parent9ee2a128e8765aa206c7595e404123737696147b (diff)
downloadchef-zero-7e2d8e6a1b23cf459becfaaf0525a930bb2bd9e3.tar.gz
Optimize requires for non-omnibus installs
require is quite slow in Ruby and doing requires for things you've already required is also slow. We've used this simple hack in Chef to speed up our requires. In the omnibus installs we patch how rubygems works to make this somewhat pointless, but this will help non-omnibus installs Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef_zero/endpoints/policy_groups_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/policy_groups_endpoint.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef_zero/endpoints/policy_groups_endpoint.rb b/lib/chef_zero/endpoints/policy_groups_endpoint.rb
index c22bf34..14a647b 100644
--- a/lib/chef_zero/endpoints/policy_groups_endpoint.rb
+++ b/lib/chef_zero/endpoints/policy_groups_endpoint.rb
@@ -1,4 +1,4 @@
-require "ffi_yajl"
+require "ffi_yajl" unless defined?(FFI_Yajl)
require_relative "../rest_base"
require_relative "../chef_data/data_normalizer"