Sha256: 9d8f75d86d44a919a3284b8030879e2e306a7df0a5f8df35444c059ef93d839d

Contents?: true

Size: 527 Bytes

Versions: 3

Compression:

Stored size: 527 Bytes

Contents

require 'multi_sync/resource'

module MultiSync
  class RemoteResource < Resource
    attribute :file

    def body
      file.body
    end

    def determine_etag
      file.etag
    rescue NoMethodError # Fog::Storage::Local::File's don't have an etag method :(
      Digest::MD5.hexdigest(File.read(path_with_root))
    end

    def determine_mtime
      file.last_modified
    end

    def determine_content_type
      file.content_type
    end

    def determine_content_length
      file.content_length
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
multi_sync-0.0.4 lib/multi_sync/resources/remote_resource.rb
multi_sync-0.0.3 lib/multi_sync/resources/remote_resource.rb
multi_sync-0.0.2 lib/multi_sync/resources/remote_resource.rb