Sha256: adc429a7da8a1c02269ae901ae5152200a953a85abc5f2e9dd4d28f85f2bb396

Contents?: true

Size: 842 Bytes

Versions: 18

Compression:

Stored size: 842 Bytes

Contents

module Heirloom
  class Catalog
    class Add

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

      def add_to_catalog(args)
        regions       = args[:regions]
        bucket_prefix = args[:bucket_prefix]

        unless verify.entry_exists_in_catalog? @name
          @logger.info "Adding #{@name} to catalog."

          sdb.put_attributes 'heirloom', 
                             "heirloom_#{@name}", 
                             "regions"       => regions, 
                             "bucket_prefix" => bucket_prefix
        end

      end

      private

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

      def verify
        @verify ||= Catalog::Verify.new :config => @config
      end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
heirloom-0.12.7 lib/heirloom/catalog/add.rb
heirloom-0.12.5 lib/heirloom/catalog/add.rb
heirloom-0.12.4 lib/heirloom/catalog/add.rb
heirloom-0.12.3 lib/heirloom/catalog/add.rb
heirloom-0.12.2 lib/heirloom/catalog/add.rb
heirloom-0.12.1 lib/heirloom/catalog/add.rb
heirloom-0.12.0 lib/heirloom/catalog/add.rb
heirloom-0.11.2 lib/heirloom/catalog/add.rb
heirloom-0.11.1 lib/heirloom/catalog/add.rb
heirloom-0.11.0 lib/heirloom/catalog/add.rb
heirloom-0.11.0.beta.2 lib/heirloom/catalog/add.rb
heirloom-0.11.0.beta.1 lib/heirloom/catalog/add.rb
heirloom-0.10.1 lib/heirloom/catalog/add.rb
heirloom-0.10.0 lib/heirloom/catalog/add.rb
heirloom-0.9.0 lib/heirloom/catalog/add.rb
heirloom-0.8.3 lib/heirloom/catalog/add.rb
heirloom-0.8.2 lib/heirloom/catalog/add.rb
heirloom-0.8.1 lib/heirloom/catalog/add.rb