Class: Saber::AutoFetcher::DRbServer

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(saber_server) ⇒ DRbServer

Returns a new instance of DRbServer.



46
47
48
# File 'lib/saber/autofetcher/server.rb', line 46

def initialize(saber_server)
  @saber_server = saber_server
end

Instance Attribute Details

#saber_serverObject (readonly)

Returns the value of attribute saber_server.



43
44
45
# File 'lib/saber/autofetcher/server.rb', line 43

def saber_server
  @saber_server
end

Class Method Details

.start(saber_server) ⇒ Object



38
39
40
# File 'lib/saber/autofetcher/server.rb', line 38

def start(saber_server)
  DRbServer.new(saber_server).start
end

Instance Method Details

#add(*names) ⇒ Object

drb. add a complete torrent.



56
57
58
59
60
61
62
# File 'lib/saber/autofetcher/server.rb', line 56

def add(*names)
  files = build_files(*names) 
  saber_server.send(files)
rescue => e
  Saber.ui.error "#{e.class.name}: #{e.message}"
  Saber.ui.error e.backtrace.join("\n")
end

#startObject



50
51
52
53
# File 'lib/saber/autofetcher/server.rb', line 50

def start
  DRb.start_service Rc.drb_uri, self
  Saber.ui.say ">> DRbSever listening on #{Rc.drb_uri}"
end