Sha256: 740b5d0a32ddbcb59ba893f00899ac24c4b6f594108815dea77fb691ec119559

Contents?: true

Size: 748 Bytes

Versions: 36

Compression:

Stored size: 748 Bytes

Contents

class Chef
  class Resource
    class RubyBlock < Chef::Resource
      def initialize(name, collection=nil, node=nil)
        super(name, collection, node)
        @resource_name = :ruby_block
        @action = :create
        @allowed_actions.push(:create)
      end
 
      def block(&block)
        if block
          @block = block
        else
          @block
        end
      end
    end
  end
end


class Chef
  class Provider
    class RubyBlock < Chef::Provider
      def load_current_resource
        Chef::Log.debug(@new_resource.inspect)
        true
      end
 
      def action_create
        @new_resource.block.call
      end
    end
  end
end

Chef::Platform.platforms[:default].merge! :ruby_block => Chef::Provider::RubyBlock

Version data entries

36 entries across 26 versions & 3 rubygems

Version Path
engineyard-jenkins-0.5.0 lib/engineyard-jenkins/cli/install_generator/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-jenkins-0.4.0 lib/engineyard-jenkins/cli/install_server_generator/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-jenkins-0.4.0 lib/engineyard-jenkins/cli/install_generator/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.3.2 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.3.2 lib/engineyard-hudson/cli/install_server/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.3.1 lib/engineyard-hudson/cli/install_server/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.3.1 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.3.0 lib/engineyard-hudson/cli/install_server/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.3.0 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.2.2 lib/engineyard-hudson/cli/server/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.2.2 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.2.1 lib/engineyard-hudson/cli/server/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.2.1 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.2.0 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.2.0 lib/engineyard-hudson/cli/server/templates/cookbooks/main/libraries/ruby_block.rb
engineyard-hudson-0.1.0 lib/engineyard-hudson/cli/install/templates/cookbooks/main/libraries/ruby_block.rb