Sha256: 4b12d1ad459aa73f156354bd0216ee521eb1c7f955475e9bedacfd5417c14ebe

Contents?: true

Size: 674 Bytes

Versions: 16

Compression:

Stored size: 674 Bytes

Contents

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

module Fog
  module Local
    class Storage

      class Directories < Fog::Collection

        model Fog::Local::Storage::Directory

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

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

      end

    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
fog-0.8.2 lib/fog/storage/models/local/directories.rb
fog-0.8.1 lib/fog/storage/models/local/directories.rb
fog-0.8.0 lib/fog/storage/models/local/directories.rb
fog-0.7.2 lib/fog/storage/models/local/directories.rb
fog-0.7.1 lib/fog/storage/models/local/directories.rb
fog-0.7.0 lib/fog/storage/models/local/directories.rb
fog-0.6.0 lib/fog/storage/models/local/directories.rb
fog-0.5.3 lib/fog/storage/models/local/directories.rb
fog-0.5.2 lib/fog/storage/models/local/directories.rb
fog-0.5.1 lib/fog/storage/models/local/directories.rb
fog-0.5.0 lib/fog/storage/models/local/directories.rb
phpfog-fog-0.4.1.3 lib/fog/storage/models/local/directories.rb
phpfog-fog-0.4.1.2 lib/fog/storage/models/local/directories.rb
phpfog-fog-0.4.1.1 lib/fog/storage/models/local/directories.rb
phpfog-fog-0.4.1 lib/fog/storage/models/local/directories.rb
fog-0.4.1 lib/fog/storage/models/local/directories.rb