Sha256: 53fec511fc096d88eb0e9cd8eca8070eb462b88cbdcb8e64b436fe2cac6b1d41

Contents?: true

Size: 912 Bytes

Versions: 5

Compression:

Stored size: 912 Bytes

Contents

module Heirloom
  class Catalog
    class Verify

      def initialize(args)
        @config = args[:config]
        @logger = @config.logger
        @region = @config.metadata_region
      end

      def catalog_domain_exists?
        if sdb.domain_exists? 'heirloom'
          @logger.debug "Catalog of Heirlooms exists in #{@region}."
          true
        else
          @logger.debug "Catalog of Heirlooms does not exist in #{@region}."
          false
        end
      end

      def entry_exists_in_catalog?(entry)
        if sdb.item_count('heirloom', "heirloom_#{entry}").zero?
          @logger.debug "#{entry} does not exist in catalog in #{@region}."
          false
        else
          @logger.debug "#{entry} exists in catalog in #{@region}."
          true
        end
      end

      private

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

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
heirloom-0.12.7 lib/heirloom/catalog/verify.rb
heirloom-0.12.5 lib/heirloom/catalog/verify.rb
heirloom-0.12.4 lib/heirloom/catalog/verify.rb
heirloom-0.12.3 lib/heirloom/catalog/verify.rb
heirloom-0.12.2 lib/heirloom/catalog/verify.rb