Sha256: 9347e754d6167b125898b6379d24792249116eb81c4be0d324d8cfc0755fb381

Contents?: true

Size: 739 Bytes

Versions: 21

Compression:

Stored size: 739 Bytes

Contents

module Ufo
  class Base
    extend Memoist
    include Stack::Helper

    def initialize(service, options={})
      @service = switch_current(service)
      @options = options

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

    def switch_current(service)
      Current.service!(service)
    end

    def info
      Info.new(@service, @options)
    end
    memoize :info

    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

    def full_service
      [@service, Ufo.env_extra].compact.join("-")
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ufo-5.0.7 lib/ufo/base.rb
ufo-5.0.6 lib/ufo/base.rb
ufo-5.0.5 lib/ufo/base.rb
ufo-5.0.4 lib/ufo/base.rb
ufo-5.0.3 lib/ufo/base.rb
ufo-5.0.2 lib/ufo/base.rb
ufo-5.0.1 lib/ufo/base.rb
ufo-5.0.0 lib/ufo/base.rb
ufo-4.6.3 lib/ufo/base.rb
ufo-4.6.2 lib/ufo/base.rb
ufo-4.6.1 lib/ufo/base.rb
ufo-4.6.0 lib/ufo/base.rb
ufo-4.5.11 lib/ufo/base.rb
ufo-4.5.10 lib/ufo/base.rb
ufo-4.5.9 lib/ufo/base.rb
ufo-4.5.8 lib/ufo/base.rb
ufo-4.5.7 lib/ufo/base.rb
ufo-4.5.6 lib/ufo/base.rb
ufo-4.5.5 lib/ufo/base.rb
ufo-4.5.4 lib/ufo/base.rb