Diff

core/hostmanager.lua @ 6779:6236668da30a

core.*: Remove use of module() function
author Kim Alvefur <zash@zash.se>
date Sat, 21 Feb 2015 10:42:19 +0100
parent 6706:60c692828cf6
child 6791:e813e8cf6046
child 8251:cb2d86f4b511
line wrap: on
line diff
--- a/core/hostmanager.lua	Sat Feb 21 10:38:44 2015 +0100
+++ b/core/hostmanager.lua	Sat Feb 21 10:42:19 2015 +0100
@@ -28,7 +28,7 @@
 local tostring, type = tostring, type;
 local setmetatable = setmetatable;
 
-module "hostmanager"
+local _ENV = nil;
 
 local host_mt = { }
 function host_mt:__tostring()
@@ -45,6 +45,8 @@
 
 local hosts_loaded_once;
 
+local activate, deactivate;
+
 local function load_enabled_hosts(config)
 	local defined_hosts = config or configmanager.getconfig();
 	local activated_any_host;
@@ -164,8 +166,12 @@
 	return true;
 end
 
-function get_children(host)
+local function get_children(host)
 	return disco_items:get(host) or NULL;
 end
 
-return _M;
+return {
+	activate = activate;
+	deactivate = deactivate;
+	get_children = get_children;
+}