Sha256: ba434de99ae76d175a7868ed761921ea0092e5e2f233257d191c2ca50e55bc72

Contents?: true

Size: 520 Bytes

Versions: 9

Compression:

Stored size: 520 Bytes

Contents

require 'astrovan/session'

module Astrovan
  # Create a deployment session for the specified remote hosts.
  #
  # The provided block will execute within the context of the newly created session.
  def using(*hosts, &block)
    raise ArgumentError, "Missing block" unless block_given?
    env = hosts.last.is_a?(Hash) ? hosts.pop : {}
    raise ArgumentError, "Missing host" unless hosts.any?
    session = Session.new(hosts.flatten, env)
    session.instance_eval(&block)
    session.close
  end
end

include Astrovan

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sbfaulkner-astrovan-0.5.0 lib/astrovan.rb
sbfaulkner-astrovan-0.5.2 lib/astrovan.rb
sbfaulkner-astrovan-0.5.3 lib/astrovan.rb
sbfaulkner-astrovan-0.5.4 lib/astrovan.rb
sbfaulkner-astrovan-0.5.6 lib/astrovan.rb
sbfaulkner-astrovan-0.5.7 lib/astrovan.rb
sbfaulkner-astrovan-0.5.8 lib/astrovan.rb
sbfaulkner-astrovan-0.5.9 lib/astrovan.rb
sbfaulkner-astrovan-0.6.0 lib/astrovan.rb