Class: Pmux::LocalAdapter

Inherits:
StorageAdapter show all
Defined in:
lib/pmux/storage_adapter.rb

Constant Summary

Constants inherited from StorageAdapter

StorageAdapter::Adapters

Instance Attribute Summary

Attributes inherited from StorageAdapter

#addrs

Instance Method Summary collapse

Methods inherited from StorageAdapter

#connect_to_storage, create, #init_node_hash, #initialize

Constructor Details

This class inherits a constructor from Pmux::StorageAdapter

Instance Method Details

#_get_file_locations(files, glob_flag = false) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/pmux/storage_adapter.rb', line 44

def _get_file_locations files, glob_flag=false
  files = Dir.glob files.join("\0") if glob_flag
  files.map {|file|
    a = addrs.map {|addr| [addr, file]}
    addrs.push addrs.shift
    [file, a]
  }
end

#get_files(args, glob_flag = false) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/pmux/storage_adapter.rb', line 36

def get_files args, glob_flag=false
  if glob_flag
    Dir.glob args.join("\0")
  else
    args
  end
end

#lookup_file(file) ⇒ Object



53
54
55
56
57
# File 'lib/pmux/storage_adapter.rb', line 53

def lookup_file file
  res = addrs.map {|addr| [addr, file]}
  addrs.push addrs.shift
  res
end