lib/omnibus/sugarable.rb in omnibus-7.0.34 vs lib/omnibus/sugarable.rb in omnibus-8.0.9

- old
+ new

@@ -1,7 +1,7 @@ # -# Copyright 2014-2018 Chef Software, Inc. +# Copyright 2014-2020, Chef Software Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # @@ -12,34 +12,25 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require "chef/sugar/architecture" -require "chef/sugar/cloud" -require "chef/sugar/constraints" -require "chef/sugar/ip" -require "chef/sugar/init" -require "chef/sugar/platform" -require "chef/sugar/platform_family" -require "chef/sugar/ruby" -require "chef/sugar/shell" -require "chef/sugar/vagrant" +require "chef-utils" unless defined?(ChefUtils::CANARY) module Omnibus module Sugarable def self.extended(base) - base.send(:extend, Chef::Sugar::DSL) + base.send(:extend, ChefUtils) base.send(:extend, Omnibus::Sugar) end def self.included(base) - base.send(:include, Chef::Sugar::DSL) + base.send(:include, ChefUtils) base.send(:include, Omnibus::Sugar) if base < Cleanroom # Make all the "sugars" available in the cleanroom (DSL) - Chef::Sugar::DSL.instance_methods.each do |instance_method| + ChefUtils.instance_methods.each do |instance_method| base.send(:expose, instance_method) end # Make all the common "sugars" available in the cleanroom (DSL) Omnibus::Sugar.instance_methods.each do |instance_method|