Mercurial Hosting > luan
diff core/src/luan/modules/host/Hosting.luan @ 503:92c3d22745b8
make _ENV optional
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 20 May 2015 23:24:46 -0600 |
parents | 5b36f663a1b8 |
children | b4f3dbe1c6e3 |
line wrap: on
line diff
--- a/core/src/luan/modules/host/Hosting.luan Tue May 19 17:57:20 2015 -0600 +++ b/core/src/luan/modules/host/Hosting.luan Wed May 20 23:24:46 2015 -0600 @@ -4,14 +4,15 @@ local Luan = require "luan:Luan" local error = Luan.error +local M = {} -port = 9101 +M.port = 9101 -function push(domain,password,dir) +function M.push(domain,password,dir) local f = Io.uri("file:"..dir) f.exists() or error("directory '"..dir.."' not found") f.is_directory() or error("'"..dir.."' is not a directory") - local socket = "socket:" .. domain .. ":" .. port + local socket = "socket:" .. domain .. ":" .. M.port local pc = Io.uri(socket).pickle_client() local pickle = pc.pickle pc.call(%> @@ -21,8 +22,8 @@ pc.close() end -function delete(domain,password) - local socket = "socket:" .. domain .. ":" .. port +function M.delete(domain,password) + local socket = "socket:" .. domain .. ":" .. M.port local pc = Io.uri(socket).pickle_client() local pickle = pc.pickle pc.call(%> @@ -31,3 +32,5 @@ <%) pc.close() end + +return M