Sha256: 6a21376538d98cb001d2e053e95e6743fa7d40a269efc8d45b75bd9a63ec140a

Contents?: true

Size: 710 Bytes

Versions: 13

Compression:

Stored size: 710 Bytes

Contents

require 'httparty'
module Smithy
  module Dragonfly
    module DataStorage
      class RemoteDataStore
        def write(content, opts={})
          # raise "Sorry friend, this datastore is read-only."
        end

        def read(uid)
          response = HTTParty.get uid, :timeout => 3
          raise DataNotFound unless response.ok?
          content = response.body
          extra_data = {}
          [
            content,            # either a File, String or Tempfile
            extra_data          # Hash with optional keys :meta, :name, :format
          ]
        end

        def destroy(uid)
          raise "Sorry friend, this datastore is read-only."
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
smithycms-0.5.99.3 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.5.99.2 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.5.99.1 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.5.99 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.5.2 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.5.1 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.5.0 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.4.5 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.4.4 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.4.3 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.4.2 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.4.1 lib/smithy/dragonfly/remote_data_store.rb
smithycms-0.4.0 lib/smithy/dragonfly/remote_data_store.rb