diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-10-17 19:07:53 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-10-17 19:07:53 +0000 |
commit | 2ece009273252437281c8cc0b84ba2ec49e5d07c (patch) | |
tree | 1c082ee4891a4717f2fea09f0df4a8946d9fdb41 /logfiles-controller.lua | |
parent | 0537a242f9709271454252e7897a7709144a3b02 (diff) | |
download | acf-alpine-baselayout-2ece009273252437281c8cc0b84ba2ec49e5d07c.tar.bz2 acf-alpine-baselayout-2ece009273252437281c8cc0b84ba2ec49e5d07c.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 'logfiles-controller.lua')
-rw-r--r-- | logfiles-controller.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/logfiles-controller.lua b/logfiles-controller.lua index 3c594f2..10d0a55 100644 --- a/logfiles-controller.lua +++ b/logfiles-controller.lua @@ -1,29 +1,31 @@ -module (..., package.seeall) +local mymodule = {} posix = require("posix") -default_action = "status" +mymodule.default_action = "status" -- Public methods -status = function (self ) +mymodule.status = function (self ) return self.model.get() end -delete = function (self) +mymodule.delete = function (self) return self.handle_form(self, self.model.get_delete, self.model.delete, self.clientdata, "Delete", "Delete File", "File Deleted") end -view = function (self) +mymodule.view = function (self) return self.model.get_filedetails(self.clientdata.filename or "", self.clientdata.grep) end -download = function (self) - local filestatus = view(self) +mymodule.download = function (self) + local filestatus = mymodule.view(self) local filecontent = filestatus.value.filecontent filecontent.label = posix.basename(filestatus.value.filename.value) return filecontent end -tail = function (self) +mymodule.tail = function (self) return self.model.tail(self.clientdata.filename, self.clientdata.offset, self.clientdata.grep) end + +return mymodule |