lib/cluster_chef/compute.rb
# Magic method to produce cloud instance:
# * returns the cloud instance, creating it if necessary.
# * executes the block in the cloud's object context
#
# @example
#   # defines a security group
#   cloud :ec2 do
#     security_group :foo
#   end
#
# @example
#   # same effect
#   cloud.security_group :foo
#
Magic method to produce cloud instance:
returns the cloud instance, creating it if necessary.
executes the block in the cloud's object context
Magic method to produce cloud instance : returns the cloud instance creating it if necessary . executes the block in the cloud ' s object context
def cloud cloud_provider=nil, hsh={}, &block
      raise "Only have ec2 so far" if cloud_provider && (cloud_provider != :ec2)
      @cloud ||= ClusterChef::Cloud::Ec2.new
      @cloud.configure(hsh, &block) if block
      @cloud
    end
def cloud cloud_provider = nil , hsh = { } , & block raise "Only have ec2 so far" if cloud_provider && ( cloud_provider != :ec2 ) @cloud ||= ClusterChef :: Cloud :: Ec2 . new @cloud . configure ( hsh , & block ) if block @cloud end
Magic method to produce cloud instance:
 returns the cloud instance, creating it if necessary.
Magic method to produce cloud instance : returns the cloud instance creating it if necessary .
cloud_provider
hsh
block
example
defines a security group cloud :ec2 do security_group :foo end
defines a security group cloud : ec2 do security_group : foo end
example
same effect cloud.security_group :foo
same effect cloud . security_group : foo