Sha256: 04734f073d4e4c58b9de3245af8dc7064c4b5e31bd70ac42246480cb1b0a9b24

Contents?: true

Size: 1.01 KB

Versions: 33

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Local
    extend Fog::Service

    requires :local_root

    model_path 'fog/local/models'
    model 'directories'
    model 'directory'
    model 'file'
    model 'files'

    class Mock
      include Collections

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

      def self.reset_data(keys=data.keys)
        for key in [*keys]
          data.delete(key)
        end
      end

      def initialize(options={})
        @local_root = ::File.expand_path(options[:local_root])
        @data       = self.class.data[@local_root]
      end

      def local_root
        @local_root
      end

      def path(partial)
        partial
      end
    end

    class Real
      include Collections

      def initialize(options={})
        @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

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/local.rb
fog-0.2.28 lib/fog/local.rb
fog-0.2.27 lib/fog/local.rb
fog-0.2.26 lib/fog/local.rb
fog-0.2.25 lib/fog/local.rb
fog-0.2.24 lib/fog/local.rb
tecnh-fog-0.2.23.vpc lib/fog/local.rb
fog-0.2.23 lib/fog/local.rb
fog-0.2.22 lib/fog/local.rb
fog-0.2.21 lib/fog/local.rb
fog-0.2.20 lib/fog/local.rb
fog-0.2.19 lib/fog/local.rb
fog-0.2.18 lib/fog/local.rb
fog-0.2.17 lib/fog/local.rb
fog-0.2.16 lib/fog/local.rb
fog-0.2.15 lib/fog/local.rb
fog-0.2.14 lib/fog/local.rb
fog-0.2.13 lib/fog/local.rb
fog-0.2.12 lib/fog/local.rb
fog-0.2.11 lib/fog/local.rb