Class: LSync::ServerController

Inherits:
BasicController show all
Defined in:
lib/lsync/controller.rb

Overview

The server controller provides event handlers with a unified interface for dealing with servers and associated actions.

Instance Attribute Summary collapse

Attributes inherited from BasicController

#logger, #script

Instance Method Summary collapse

Constructor Details

#initialize(script, logger, server) ⇒ ServerController

Returns a new instance of ServerController.



19
20
21
22
23
# File 'lib/lsync/controller.rb', line 19

def initialize(script, logger, server)
	super(script, logger)
	
	@server = server
end

Instance Attribute Details

#serverObject (readonly)

The current server.



26
27
28
# File 'lib/lsync/controller.rb', line 26

def server
  @server
end

Instance Method Details

#run!(*function) ⇒ Object

Run a given shell script on the server.



29
30
31
32
# File 'lib/lsync/controller.rb', line 29

def run!(*function)
	action = Action.new(function)
	action.run_on_server(@server, @logger)
end