Sha256: 9574b1d0d925d41b58347d9fb40f44865b8135ab7cec98607b6e3a61986d23c0
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
require 'delegate' module EmberCliDeployRedis # Holds a list of deployed application revisions that may be used. # Delegates to the array of revisions, so standard {Array} methods can be called. class RevisionList < SimpleDelegator attr_reader :application attr_reader :revisions def self.from_redis(application) new application, list_from_redis(application).map { |r| Revision.new(application, r) } end def initialize(application, revisions) self.application = application self.revisions = revisions super(revisions) end def method_missing(method, *args, &block) if revisions.respond_to? method revisions.send(method, *args, &block) else super end end private attr_writer :application attr_writer :revisions def self.list_from_redis(application) key = EmberCliDeployRedis.configuration.redis_key_for_revision_list(application) EmberCliDeployRedis.configuration.redis.lrange(key, 0, -1) end end end
Version data entries
3 entries across 3 versions & 1 rubygems