Sha256: 17ec245f05411b98d8c9c3eec7faf156b1f7cf4ab3ec348429c1ab7871504f85

Contents?: true

Size: 577 Bytes

Versions: 24

Compression:

Stored size: 577 Bytes

Contents

module SimpleDeploy
  class EntryLister

    def initialize
      @domain = 'stacks'
      @config = SimpleDeploy.config
    end

    def all
      if sdb_connect.domain_exists? @domain
        e = sdb_connect.select "select * from #{@domain}"
        entries = e.keys.map do |name|
          remove_region_from_entry(name)
        end
      end
      entries ? entries : []
    end

    private

    def sdb_connect
      @sdb_connect ||= AWS::SimpleDB.new
    end

    def remove_region_from_entry(name)
      name.gsub(/-[a-z]{2}-[a-z]*-[0-9]{1,2}$/, '')
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 lib/simple_deploy/entry_lister.rb
simple_deploy-0.10.1 lib/simple_deploy/entry_lister.rb
simple_deploy-0.10.0 lib/simple_deploy/entry_lister.rb
simple_deploy-0.10.0.beta.3 lib/simple_deploy/entry_lister.rb
simple_deploy-0.10.0.beta.2 lib/simple_deploy/entry_lister.rb
simple_deploy-0.10.0.beta.1 lib/simple_deploy/entry_lister.rb
simple_deploy-0.9.2 lib/simple_deploy/entry_lister.rb
simple_deploy-0.9.1 lib/simple_deploy/entry_lister.rb
simple_deploy-0.9.0 lib/simple_deploy/entry_lister.rb
simple_deploy-0.8.2 lib/simple_deploy/entry_lister.rb
simple_deploy-0.8.2.beta1 lib/simple_deploy/entry_lister.rb
simple_deploy-0.8.1.beta1 lib/simple_deploy/entry_lister.rb
simple_deploy-0.8.0 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.8 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.7 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.7.beta.1 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.6 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.6.beta.6 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.6.beta.5 lib/simple_deploy/entry_lister.rb
simple_deploy-0.7.6.beta.3 lib/simple_deploy/entry_lister.rb