Class: Fairy::Exec

Inherits:
Filter show all
Defined in:
lib/fairy/client/exec.rb

Defined Under Namespace

Modules: Interface

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Filter

#backend, #backend=, #backend_class, #def_pool_variable, #initialize

Constructor Details

This class inherits a constructor from Fairy::Filter

Class Method Details

.exec(fairy, opts, vnode_spec) ⇒ Object



22
23
24
25
26
# File 'lib/fairy/client/exec.rb', line 22

def Exec.exec(fairy, opts, vnode_spec)
  exec = new(fairy, opts)
  exec.start(vnode_spec)
  exec
end

Instance Method Details

#backend_class_nameObject



29
30
31
# File 'lib/fairy/client/exec.rb', line 29

def backend_class_name
  "CExec"
end

#start(vnode_spec) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fairy/client/exec.rb', line 33

def start(vnode_spec)
  @vnode_spec = vnode_spec
  case @vnode_spec
  when Array
	vf = VFile.real_files(@vnode_spec)
  when VFile
	vf = @vnode_spec
  when String
	if VFile.vfile?(@vnode_spec)
	  vf = VFile.vfile(@vnode_spec)
	else
	  vf = VFile.real_files([@vnode_spec])
	end
  else
	ERR::Raise ERR::IllegalVFile
  end

  backend.start(vf)
end