Sha256: 026065688692e27d141ed4c719c751fc2a7d7c4e46b7dd98eebf18fc71dd30fd

Contents?: true

Size: 665 Bytes

Versions: 31

Compression:

Stored size: 665 Bytes

Contents

require 'fog/core/collection'
require 'fog/local/models/storage/directory'

module Fog
  module Storage
    class Local

      class Directories < Fog::Collection

        model Fog::Storage::Local::Directory

        def all
          data = Dir.entries(service.local_root).select do |entry|
            entry[0...1] != '.' && ::File.directory?(service.path_to(entry))
          end.map do |entry|
            {:key => entry}
          end
          load(data)
        end

        def get(key)
          if ::File.directory?(service.path_to(key))
            new(:key => key)
          else
            nil
          end
        end

      end

    end
  end
end

Version data entries

31 entries across 31 versions & 7 rubygems

Version Path
cifrado-0.2.1 vendor/fog/lib/fog/local/models/storage/directories.rb
cifrado-0.2.0 vendor/fog/lib/fog/local/models/storage/directories.rb
gapinc-fog-1.12.1.2.1 lib/fog/local/models/storage/directories.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/local/models/storage/directories.rb
fog-1.15.0 lib/fog/local/models/storage/directories.rb
gapinc-fog-1.14.0 lib/fog/local/models/storage/directories.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/local/models/storage/directories.rb
fog-1.14.0 lib/fog/local/models/storage/directories.rb
fog-1.13.0 lib/fog/local/models/storage/directories.rb
gapinc-fog-1.12.1.2 lib/fog/local/models/storage/directories.rb
gapinc-fog-1.12.1.1 lib/fog/local/models/storage/directories.rb
gapinc-fog-1.12.1a lib/fog/local/models/storage/directories.rb
gapinc-fog-1.12.1 lib/fog/local/models/storage/directories.rb
fog-1.12.1 lib/fog/local/models/storage/directories.rb
fog-1.12.0 lib/fog/local/models/storage/directories.rb
hpfog-0.0.20 lib/fog/local/models/storage/directories.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/local/models/storage/directories.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/local/models/storage/directories.rb
fog-1.11.1 lib/fog/local/models/storage/directories.rb
fog-1.11.0 lib/fog/local/models/storage/directories.rb