Class: Vos::Drivers::Local

Inherits:
Abstract show all
Includes:
Vfs::Storages::Local::LocalVfsHelper
Defined in:
lib/vos/drivers/local.rb

Instance Attribute Summary

Attributes inherited from Abstract

#options

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Vos::Drivers::Abstract

Instance Method Details

#bash(command) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/vos/drivers/local.rb', line 29

def bash command
  code, stdout_and_stderr = Open3.popen2e command do |stdin, stdout_and_stderr, wait_thread|  
    [wait_thread.value.to_i, stdout_and_stderr.read]
  end

  return code, stdout_and_stderr
end

#closeObject



14
# File 'lib/vos/drivers/local.rb', line 14

def close; end

#exec(command) ⇒ Object

Shell



20
21
22
23
24
25
26
# File 'lib/vos/drivers/local.rb', line 20

def exec command        
  code, stdout, stderr = Open3.popen3 command do |stdin, stdout, stderr, waitth|  
    [waitth.value.to_i, stdout.read, stderr.read]
  end

  return code, stdout, stderr
end

#hostObject



42
# File 'lib/vos/drivers/local.rb', line 42

def host; 'localhost' end

#open(&block) ⇒ Object Also known as: open_fs



10
11
12
# File 'lib/vos/drivers/local.rb', line 10

def open &block
  block.call self if block
end

#to_sObject

Other



41
# File 'lib/vos/drivers/local.rb', line 41

def to_s; '' end