Sha256: 86c228859badc21a268b9f18eca575aee5b6a9311e8aa743d162e95ee665ea03

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

module Heirloom

  class ArtifactLister

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

    def list(limit=10)
      sdb.select("select * from #{@name} where built_at > '2000-01-01T00:00:00.000Z'\
                  order by built_at desc limit #{limit}").keys
    end

    private

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

    def artifact_reader(id)
      @artifact_reader ||= ArtifactReader.new :config => @config,
                                              :name   => @name,
                                              :id     => id
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heirloom-0.1.4 lib/heirloom/artifact/artifact_lister.rb