Class: Daps::Application

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

Instance Method Summary collapse

Instance Method Details

#pull(remote, dir) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/daps/application.rb', line 11

def pull(remote, dir)
  remote = remote.sub(/^http[s]?[:]\/\//, 'daps://')
  remote = "daps://#{remote}" unless remote[0,7] == 'daps://'
  remote = URI.parse(remote)

  port  = remote.port || 5001
  token = File.basename(remote.path)
  remote = remote.host

  client = Daps::Client.new(dir, remote, token, port)
  client.start!
end

#server(dir, token = nil) ⇒ Object



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

def server(dir, token=nil)
  server = Daps::Server.new(dir, token, options.port)
  server.start!
end