Sha256: 4dabf24cd0a44ca663a8fa34927ba5a67e13a3162973bb154ac7eab7a4f74180

Contents?: true

Size: 1.5 KB

Versions: 31

Compression:

Stored size: 1.5 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={})
          require 'mime/types'
          @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

31 entries across 31 versions & 9 rubygems

Version Path
gapinc-fog-1.12.1.2.1 lib/fog/ninefold/storage.rb
fog-1.15.0 lib/fog/ninefold/storage.rb
gapinc-fog-1.14.0 lib/fog/ninefold/storage.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/ninefold/storage.rb
fog-1.14.0 lib/fog/ninefold/storage.rb
fog-1.13.0 lib/fog/ninefold/storage.rb
gapinc-fog-1.12.1.2 lib/fog/ninefold/storage.rb
gapinc-fog-1.12.1.1 lib/fog/ninefold/storage.rb
gapinc-fog-1.12.1a lib/fog/ninefold/storage.rb
gapinc-fog-1.12.1 lib/fog/ninefold/storage.rb
fog-1.12.1 lib/fog/ninefold/storage.rb
fog-1.12.0 lib/fog/ninefold/storage.rb
hpfog-0.0.20 lib/fog/ninefold/storage.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/ninefold/storage.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/ninefold/storage.rb
fog-nirvanix-1.8.2 lib/fog/ninefold/storage.rb
fog-1.11.1 lib/fog/ninefold/storage.rb
fog-1.11.0 lib/fog/ninefold/storage.rb
fog-nirvanix-1.8.1 lib/fog/ninefold/storage.rb
fog-1.10.1 lib/fog/ninefold/storage.rb