Sha256: 0fbc072ba2bd6dd13be707dc5760c8c18ef593d4b8b97fc2088fd5174b1a39a1
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
require "fog" module Capistrano module Elobuff module Ec2 class Server def initialize(fog_server, application) @server = fog_server @application = application end def to_s "%-24s%-16s%-48s%-16s%-16s%-16s%-24s%s" % [name, id, address, @server.image_id, @server.availability_zone, @server.state, @server.groups.uniq.join(","), roles.join(",")] end def available? @server.state == "running" end def id @server.id end def slug @server.id.gsub(/i-/, "") end def name @server.tags["Name"] end def name=(string) @server.tags["Name"] = string end def address @server.dns_name end def tags @server.tags end def zone @server.availability_zone end def roles @server.tags[@application].split(",").map(&:to_sym) end def roles=(string) @server.tags[@application] = string end def terminate! @server.destroy end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
capistrano-elobuff-0.2.7 | lib/capistrano/elobuff/ec2/server.rb |
capistrano-elobuff-0.2.6 | lib/capistrano/elobuff/ec2/server.rb |