diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-18 19:58:50 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-18 19:58:50 +0000 |
commit | 99f69b51db21781c3775956cb03acb64b3cb7477 (patch) | |
tree | d5ce210f9a8587ecedb8663dedc021e5940d07fc /asterisk-controller.lua | |
parent | 1d6fcde83bef7e14fd81d2d9c7425f33b39a6604 (diff) | |
download | acf-asterisk-99f69b51db21781c3775956cb03acb64b3cb7477.tar.bz2 acf-asterisk-99f69b51db21781c3775956cb03acb64b3cb7477.tar.xz |
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.
Diffstat (limited to 'asterisk-controller.lua')
-rw-r--r-- | asterisk-controller.lua | 15 |
1 files changed, 8 insertions, 7 deletions
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 |