Sha256: f14bb5d477e347bc0f37233a69b4b1c02197174a55d367108a576288d38f78fd
Contents?: true
Size: 780 Bytes
Versions: 19
Compression:
Stored size: 780 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 = if ::File.directory?(service.local_root) Dir.entries(service.local_root).select do |entry| entry[0...1] != '.' && ::File.directory?(service.path_to(entry)) end.map do |entry| {:key => entry} end else [] end load(data) end def get(key, options = {}) if ::File.directory?(service.path_to(key)) new(:key => key) else nil end end end end end end
Version data entries
19 entries across 19 versions & 5 rubygems