From 99f69b51db21781c3775956cb03acb64b3cb7477 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 18 Oct 2013 19:58:50 +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. --- asterisk-controller.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'asterisk-controller.lua') diff --git a/asterisk-controller.lua b/asterisk-controller.lua index 404a141..0f04d00 100644 --- a/asterisk-controller.lua +++ b/asterisk-controller.lua @@ -1,21 +1,22 @@ -- the squid controller +local mymodule = {} -module (..., package.seeall) +mymodule.default_action = "status" -default_action = "status" - -status = function( self ) +mymodule.status = function( self ) return self.model.get_status() end -startstop = function( self ) +mymodule.startstop = function( self ) return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata) end -listfiles = function( self ) +mymodule.listfiles = function( self ) return self.model.list_files() end -edit = function( self ) +mymodule.edit = function( self ) return self.handle_form(self, self.model.get_file, self.model.update_file, self.clientdata, "Save", "Edit File", "File Saved") end + +return mymodule -- cgit v1.2.3