Sha256: 5406ed3dc4a5b5740281c2d17753077ed4c8e570f928779c327d1f27028a727d

Contents?: true

Size: 1.67 KB

Versions: 10

Compression:

Stored size: 1.67 KB

Contents

#
# Copyright 2014 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
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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'
# NOTE: We cannot include the constraints library because of the conflicting
# +version+ attribute would screw things up. You can still use the
# +Chef::Sugar::Constraint.version('1.2.3') for comparing versions.
#
# require 'chef/sugar/constraints'
require 'chef/sugar/ip'
require 'chef/sugar/platform'
require 'chef/sugar/platform_family'
require 'chef/sugar/ruby'
require 'chef/sugar/shell'
require 'chef/sugar/vagrant'

module Omnibus
  module Sugarable
    def self.included(base)
      base.send(:include, Chef::Sugar::DSL)

      if base < Cleanroom
        # Make all the "sugars" available in the cleanroom (DSL)
        Chef::Sugar::DSL.instance_methods.each do |instance_method|
          base.send(:expose, instance_method)
        end
      end
    end

    # This method is used by Chef Sugar to easily add the DSL. By mimicing
    # Chef's +node+ object, we can easily include the existing DSL into
    # Omnibus project as if it were Chef. Otherwise, we would need to rewrite
    # all the DSL methods.
    def node
      Ohai
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
omnibus-4.0.0 lib/omnibus/sugarable.rb
omnibus-4.0.0.rc.2 lib/omnibus/sugarable.rb
omnibus-4.0.0.rc.1 lib/omnibus/sugarable.rb
omnibus-3.2.2 lib/omnibus/sugarable.rb
omnibus-4.0.0.beta.1 lib/omnibus/sugarable.rb
omnibus-3.2.1 lib/omnibus/sugarable.rb
omnibus-3.2.0 lib/omnibus/sugarable.rb
omnibus-3.2.0.rc.3 lib/omnibus/sugarable.rb
omnibus-3.2.0.rc.2 lib/omnibus/sugarable.rb
omnibus-3.2.0.rc.1 lib/omnibus/sugarable.rb