Sha256: 093e80d484e9bde48ba65c5e71d5100d316d9be9d0d9203d510d3fc0a06f6f27

Contents?: true

Size: 1.23 KB

Versions: 7

Compression:

Stored size: 1.23 KB

Contents

module Fog
  module Storage
    class Local < Fog::Service

      requires :local_root

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

      class Mock

        def self.data
          @data ||= Hash.new do |hash, key|
            hash[key] = {}
          end
        end

        def self.reset
          @data = nil
        end

        def initialize(options={})
          Fog::Mock.not_implemented

          require 'mime/types'
          @local_root = ::File.expand_path(options[:local_root])
        end

        def data
          self.class.data[@local_root]
        end

        def local_root
          @local_root
        end

        def path_to(partial)
          ::File.join(@local_root, partial)
        end

        def reset_data
          self.class.data.delete(@local_root)
        end

      end

      class Real

        def initialize(options={})
          require 'mime/types'
          @local_root = ::File.expand_path(options[:local_root])
        end

        def local_root
          @local_root
        end

        def path_to(partial)
          ::File.join(@local_root, partial)
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/storage/local.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/storage/local.rb
fog-0.11.0 lib/fog/storage/local.rb
fog-0.10.0 lib/fog/storage/local.rb
fog4encbs-0.9.0.1 lib/fog/storage/local.rb
fog4encbs-0.9.0 lib/fog/storage/local.rb
fog-0.9.0 lib/fog/storage/local.rb