Class: Fluffy::Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/fluffy.rb

Class Method Summary collapse

Class Method Details

.[](pattern) ⇒ Object



255
256
257
# File 'lib/fluffy.rb', line 255

def self.[](pattern)
  glob(pattern)
end

.chdir(dir, &blk) ⇒ Object



263
264
265
# File 'lib/fluffy.rb', line 263

def self.chdir(dir, &blk)
  RealDir.chdir(dir, blk)
end

.entries(path) ⇒ Object



259
260
261
# File 'lib/fluffy.rb', line 259

def self.entries(path)
  RealDir.entries(path)
end

.glob(pattern) ⇒ Object



245
246
247
248
249
250
251
252
253
# File 'lib/fluffy.rb', line 245

def self.glob(pattern)
  RealDir.glob(pattern)
  #if pattern[-1,1] == '*'
  #  blk = proc { |entry| entry.to_s }
  #else
  #  blk = proc { |entry| entry[1].parent.to_s }
  #end
  #(FileSystem.find(pattern) || []).map(&blk).uniq.sort
end

.method_missing(meth, *args, &block) ⇒ Object



278
279
280
# File 'lib/fluffy.rb', line 278

def self.method_missing(meth, *args, &block)
  RealDir.send(meth, *args, &block)
end


267
268
269
270
271
# File 'lib/fluffy.rb', line 267

def self.unlink(dirpath)
  Fluffy.cloud_runner(self, :unlink, dirpath) do |s3_path, key|
    s3_path.bucket.key(key).delete
  end
end