Sha256: d3f6591ca07d75802309d403b66a326e4d8e18e37a0e2e4a25ff263472c0d5e1

Contents?: true

Size: 504 Bytes

Versions: 5

Compression:

Stored size: 504 Bytes

Contents

module Stackster
  class EntryLister

    def initialize(args)
      @domain = 'stacks'
      @config = args[:config]
    end

    def all
      entries = sdb_connect.select "select * from #{@domain}"
      entries.keys.map do |name|
        remove_region_from_entry(name)
      end
    end

    private

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

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

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stackster-0.2.4 lib/stackster/entry/entry_lister.rb
stackster-0.2.3 lib/stackster/entry/entry_lister.rb
stackster-0.2.2 lib/stackster/entry/entry_lister.rb
stackster-0.2.1 lib/stackster/entry/entry_lister.rb
stackster-0.2.0 lib/stackster/entry/entry_lister.rb