Class: Fog::Local::Storage::Directories

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/local/models/directories.rb

Instance Method Summary collapse

Instance Method Details

#allObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fog/local/models/directories.rb', line 7

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

#get(key, options = {}) ⇒ Object



20
21
22
# File 'lib/fog/local/models/directories.rb', line 20

def get(key, options = {})
  create_directory(key, options) if ::File.directory?(service.path_to(key))
end