Sha256: 3cf139b606c581e0d705a700e45b99224a3f887183012aa7040d3cb0b9d34c5c

Contents?: true

Size: 609 Bytes

Versions: 24

Compression:

Stored size: 609 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

24 entries across 24 versions & 1 rubygems

Version Path
shuttle-deploy-0.2.0.beta5 lib/shuttle/target.rb
shuttle-deploy-0.2.0.beta4 lib/shuttle/target.rb
shuttle-deploy-0.2.0.beta3 lib/shuttle/target.rb
shuttle-deploy-0.2.0.beta2 lib/shuttle/target.rb