Sha256: c9b3d67ee34a2c1658a703ce76872b87e791aedbaad984fe14baed0ee9776ee5

Contents?: true

Size: 1.47 KB

Versions: 39

Compression:

Stored size: 1.47 KB

Contents

require 'fog/ninefold'
require 'fog/storage'
require 'fog/atmos'

module Fog
  module Storage
    class Ninefold < Fog::Storage::Atmos
      STORAGE_HOST = "onlinestorage.ninefold.com" #"api.ninefold.com"
      STORAGE_PATH = "" #"/storage/v1.0"
      STORAGE_PORT = "80" # "443"
      STORAGE_SCHEME = "http" # "https"

      requires :ninefold_storage_token, :ninefold_storage_secret
      recognizes :persistent

      model_path 'fog/atmos/models/storage'
      model       :directory
      collection  :directories
      model       :file
      collection  :files

      module Utils
      end

      class Mock < Fog::Storage::Atmos::Mock
        include Utils

        def initialize(options={})
          @ninefold_storage_token = options[:ninefold_storage_token]
          @ninefold_storage_secret = options[:ninefold_storage_secret]
        end

        def request(options)
          raise "Ninefold Storage mocks not implemented"
        end

      end

      class Real < Fog::Storage::Atmos::Real
        include Utils

        def initialize(options={})
          endpoint = "#{STORAGE_SCHEME}://"\
                     "#{STORAGE_HOST}:"\
                     "#{STORAGE_PORT}"\
                     "#{STORAGE_PATH}"
          options[:atmos_storage_endpoint] = endpoint
          options[:atmos_storage_token] = options[:ninefold_storage_token]
          options[:atmos_storage_secret] = options[:ninefold_storage_secret]
          super(options)
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/ninefold/storage.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/ninefold/storage.rb
fog-1.20.0 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/ninefold/storage.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/ninefold/storage.rb
fog-1.19.0 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/ninefold/storage.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/ninefold/storage.rb