module Stackster class EntryLister def initialize(environment) @environment = environment @domain = 'stacks' @sdb_connect = AWS::SimpleDB.new @environment end def all entries = @sdb_connect.select "select * from #{@domain}" entries.keys.map do |name| remove_region_from_entry(name) end end def remove_region_from_entry(name) name.gsub(/-[a-z]{2}-[a-z]*-[0-9]{1,2}$/, '') end end end