Class: Daps::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/daps/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir, remote, token, port) ⇒ Client

Returns a new instance of Client.



5
6
7
# File 'lib/daps/client.rb', line 5

def initialize(dir, remote, token, port)
  @dir, @remote, @token, @port = File.expand_path(dir), remote, token, port
end

Instance Method Details

#start!Object



9
10
11
12
13
14
# File 'lib/daps/client.rb', line 9

def start!
  FileUtils.mkdir_p(@dir)
  system(%{
    curl http://#{@remote}:#{@port}/#{@token} | tar --directory=#{@dir} -xzf -
  })
end