class Ufo::Base

Public Class Methods

new(service, options={}) click to toggle source
# File lib/ufo/base.rb, line 6
def initialize(service, options={})
  @service = switch_current(service)
  @options = options

  @cluster = @options[:cluster] || default_cluster(@service)
  @stack_name = adjust_stack_name(@cluster, @service)
end

Public Instance Methods

full_service() click to toggle source
# File lib/ufo/base.rb, line 31
def full_service
  [@service, Ufo.env_extra].compact.join("-")
end
info() click to toggle source
# File lib/ufo/base.rb, line 18
def info
  Info.new(@service, @options)
end
no_service_message() click to toggle source
# File lib/ufo/base.rb, line 23
    def no_service_message
      <<-EOL
No #{@service.color(:green)} ecs service found.
No CloudFormation stack named #{@stack_name.color(:green)} found.
Are sure it exists?
      EOL
    end
switch_current(service) click to toggle source
# File lib/ufo/base.rb, line 14
def switch_current(service)
  Current.service!(service)
end