Sha256: 309a52898fb0d0181c70d9eaa9cfd241c3fce5a7b7cc11459b8790e1be8bd31c

Contents?: true

Size: 975 Bytes

Versions: 16

Compression:

Stored size: 975 Bytes

Contents

require 'vfs/storages/local'

module Vos
  module Drivers
    class Local < Abstract                  
      # 
      # Vfs
      # 
      include Vfs::Storages::Local::LocalVfsHelper
      def open &block
        block.call self if block
      end
      alias_method :open_fs, :open
      def close; end
      
      
      # 
      # Shell
      # 
      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
      
      
      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
      
      
      # 
      # Other
      # 
      def to_s; '' end
      def host; 'localhost' end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vos-0.3.12 lib/vos/drivers/local.rb
vos-0.3.11 lib/vos/drivers/local.rb
vos-0.3.10 lib/vos/drivers/local.rb
vos-0.3.9 lib/vos/drivers/local.rb
vos-0.3.8 lib/vos/drivers/local.rb
vos-0.3.7 lib/vos/drivers/local.rb
vos-0.3.6 lib/vos/drivers/local.rb
vos-0.3.5 lib/vos/drivers/local.rb
vos-0.3.4 lib/vos/drivers/local.rb
vos-0.3.3 lib/vos/drivers/local.rb
vos-0.3.2 lib/vos/drivers/local.rb
vos-0.3.1 lib/vos/drivers/local.rb
vos-0.3 lib/vos/drivers/local.rb
vos-0.2.1 lib/vos/drivers/local.rb
vos-0.2 lib/vos/drivers/local.rb
vos-0.1.4 lib/vos/drivers/local.rb