class RemoteModule
Public Class Methods
Source
# File lib/rbot/core/remote.rb, line 328 def initialize super @port = @bot.config['remote.port'] @host = @bot.config['remote.host'] @drb = nil begin start_service if @bot.config['remote.autostart'] rescue => e error "couldn't start remote service provider: #{e.inspect}" end end
Calls superclass method
Public Instance Methods
Source
# File lib/rbot/core/remote.rb, line 350 def cleanup stop_service super end
Calls superclass method
Source
# File lib/rbot/core/remote.rb, line 355 def handle_start(m, params) if @drb rep = "remote service provider already running" rep << " on port #{@port}" if m.private? else begin start_service(@port) rep = "remote service provider started" rep << " on port #{@port}" if m.private? rescue rep = "couldn't start remote service provider" end end m.reply rep end
Source
# File lib/rbot/core/remote.rb, line 375 def remote_login(m, params) id = @bot.auth.remote_login(params[:botuser], params[:password]) raise "login failed" unless id return id end
Source
# File lib/rbot/core/remote.rb, line 371 def remote_test(m, params) @bot.say params[:channel], "This is a remote test" end
Source
# File lib/rbot/core/remote.rb, line 340 def start_service raise "Remote service provider already running" if @drb @drb = DRb.start_service("druby://#{@host}:#{@port}", @bot.remote_object) end
Source
# File lib/rbot/core/remote.rb, line 345 def stop_service @drb.stop_service if @drb @drb = nil end