Sha256: 5e31ff6050cd5a7f9d70aea2f8bb9640c8ea4d46ce8d088faa913b1ed5f32e61

Contents?: true

Size: 595 Bytes

Versions: 1

Compression:

Stored size: 595 Bytes

Contents

module Shuttle
  class Target
    attr_reader :host, :user, :password
    attr_reader :deploy_to

    def initialize(hash)
      @host      = hash[:host]
      @user      = hash[:user]
      @password  = hash[:password]
      @deploy_to = hash[:deploy_to]
    end

    def connection
      @connection ||= Net::SSH::Session.new(host, user, password)
    end

    def validate!
      raise Shuttle::ConfigError, "Host required" if host.nil?
      raise Shuttle::ConfigError, "User required" if user.nil?
      raise Shuttle::ConfigError, "Deploy path required" if deploy_to.nil?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shuttle-deploy-0.2.0.beta1 lib/shuttle/target.rb