Class: Saber::AutoFetcher::Server

Inherits:
Object
  • Object
show all
Includes:
Blather::DSL
Defined in:
lib/saber/autofetcher/server.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



9
10
11
12
13
14
15
# File 'lib/saber/autofetcher/server.rb', line 9

def self.start
  s = Server.new
  DRbServer.start(s)
  s.start

  EM.run { s.run }
end

Instance Method Details

#runObject



17
18
19
# File 'lib/saber/autofetcher/server.rb', line 17

def run
  client.run
end

#send(files) ⇒ Object



29
30
31
32
33
# File 'lib/saber/autofetcher/server.rb', line 29

def send(files)
  msg = files.join("\n")
  Saber.ui.debug files.map{|v| "SEND #{v}"}.join("\n")
  say Rc.client.xmpp.jid , msg
end

#startObject



21
22
23
24
25
26
27
# File 'lib/saber/autofetcher/server.rb', line 21

def start
  rc = Rc.server.xmpp
  setup rc.jid, rc.password, rc.host, rc.port

  when_ready { Saber.ui.say ">> Connected to xmpp at #{jid}" }
  disconnected { client.connect }
end