Sha256: 94a71907456663a48bb7f2ef3c121874f885b8d61b3b6c71eac05446e2160dc0
Contents?: true
Size: 669 Bytes
Versions: 8
Compression:
Stored size: 669 Bytes
Contents
require 'fog/collection' require 'fog/local/models/storage/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
8 entries across 8 versions & 1 rubygems