Class: Zeiger::FileListClient

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

Class Method Summary collapse

Class Method Details

.run(pwd, command, q = nil, *args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/zeiger/file_list_client.rb', line 3

def self.run pwd, command, q=nil, *args
  Socket.unix(SOCKET_NAME) { |sock|
    s = YAML.dump({ pwd: pwd, files: q })
    sock.write([s.bytesize].pack("I"))
    sock.write(s)

    while !sock.eof?
      puts sock.readline
    end
  }
end