From 2ece009273252437281c8cc0b84ba2ec49e5d07c Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Oct 2013 19:07:53 +0000 Subject: Remove all calls to 'module' in preparation for move to Lua 5.2 Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment. --- health-controller.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'health-controller.lua') diff --git a/health-controller.lua b/health-controller.lua index f5cc26c..68f895e 100644 --- a/health-controller.lua +++ b/health-controller.lua @@ -1,26 +1,26 @@ -module (..., package.seeall) +local mymodule = {} -default_action = "system" +mymodule.default_action = "system" -- Public methods -system = function (self ) +mymodule.system = function (self ) return self.model:get_system() end -storage = function (self ) +mymodule.storage = function (self ) return self.model:get_storage() end -network = function (self ) +mymodule.network = function (self ) return self.model:get_network() end -proc = function (self ) +mymodule.proc = function (self ) return self.model:get_proc() end -networkstats = function(self) +mymodule.networkstats = function(self) local retval = self.model.get_networkstats() if self.conf.viewtype == "html" then local intf = self:new("alpine-baselayout/interfaces") @@ -34,3 +34,5 @@ networkstats = function(self) end return retval end + +return mymodule -- cgit v1.2.3