Sha256: 3a25bf5ac47771324f515202624722a9c519b45dfbc596e2f0295510d12207a6

Contents?: true

Size: 1.45 KB

Versions: 15

Compression:

Stored size: 1.45 KB

Contents

require 'fog/ninefold'
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/storage/atmos/models'
      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

15 entries across 15 versions & 2 rubygems

Version Path
fog-1.38.0 lib/fog/ninefold/storage.rb
fog-1.37.0 lib/fog/ninefold/storage.rb
fog-1.36.0 lib/fog/ninefold/storage.rb
fog-1.35.0 lib/fog/ninefold/storage.rb
fog-2.0.0.pre.0 lib/fog/ninefold/storage.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/ninefold/storage.rb
fog-1.34.0 lib/fog/ninefold/storage.rb
fog-1.33.0 lib/fog/ninefold/storage.rb
fog-1.32.0 lib/fog/ninefold/storage.rb
fog-1.31.0 lib/fog/ninefold/storage.rb
fog-1.30.0 lib/fog/ninefold/storage.rb
fog-1.29.0 lib/fog/ninefold/storage.rb
fog-1.28.0 lib/fog/ninefold/storage.rb
fog-1.27.0 lib/fog/ninefold/storage.rb
fog-1.26.0 lib/fog/ninefold/storage.rb