Sha256: cd270471202b1fce62ee3c9821346eb318116aa53bb347cb83b48be43ec53472

Contents?: true

Size: 698 Bytes

Versions: 3

Compression:

Stored size: 698 Bytes

Contents

module Ufo
  class Base
    extend Memoist
    include Stack::Helper

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

      @pretty_service_name = Ufo.pretty_service_name(@service)
      @cluster = @options[:cluster] || default_cluster
      @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 #{@pretty_service_name.color(:green)} found.
No CloudFormation stack named #{@stack_name} found.
Are sure it exists?
      EOL
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ufo-4.3.1 lib/ufo/base.rb
ufo-4.3.0 lib/ufo/base.rb
ufo-4.2.0 lib/ufo/base.rb