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 /hostname-model.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 'hostname-model.lua')
-rw-r--r-- | hostname-model.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hostname-model.lua b/hostname-model.lua index 3094393..8e20707 100644 --- a/hostname-model.lua +++ b/hostname-model.lua @@ -1,10 +1,10 @@ -- hostname model methods -module (..., package.seeall) +local mymodule = {} fs = require("acf.fs") modelfunctions = require("modelfunctions") -get = function (fqdn) +mymodule.get = function (fqdn) local n if fqdn then n = modelfunctions.run_executable({"hostname", "-f"}) @@ -20,11 +20,11 @@ get = function (fqdn) end -read_name = function () - return cfe({ type="group", value={hostname=get(false)}, label="Hostname" }) +mymodule.read_name = function () + return cfe({ type="group", value={hostname=mymodule.get(false)}, label="Hostname" }) end -update_name = function(self, name) +mymodule.update_name = function(self, name) local success = true if success then @@ -36,3 +36,5 @@ update_name = function(self, name) return name end + +return mymodule |