Sha256: 2c4215df732ce38fd40c6bfdbcbde8037cf63c204fbc1a62285c82c7a6773c75

Contents?: true

Size: 751 Bytes

Versions: 1

Compression:

Stored size: 751 Bytes

Contents

require_relative 'zip_packages'

module Resync
  # Extends {ChangeDump} and {ResourceDump} to provide
  # transparent access to the linked bitstream packages
  module Dump
    # Injects a +:zip_package+ method into each resource,
    # downloading the (presumed) bitstream package to a
    # temp file and returning it as a {ZipPackage}
    def resources=(value)
      super
      resources.each do |r|
        def r.zip_package
          @zip_package ||= ZipPackage.new(download_to_temp_file)
        end
      end
    end

    # A list (downloaded lazily) of the {ZipPackage}s for each resource
    # @return [ZipPackages] the zip packages for each resource
    def zip_packages
      @zip_packages ||= ZipPackages.new(resources)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
resync-client-0.1.2 lib/resync/client/dump.rb