Skip to content

Commit

Permalink
update version to 0.02
Browse files Browse the repository at this point in the history
  • Loading branch information
smallfish committed Nov 25, 2012
1 parent 6c62eb8 commit 62e3cc0
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/resty/beanstalkd.lua
@@ -1,17 +1,19 @@
-- Copyright (C) 2012 Chen "smallfish" Xiaoyu (陈小玉)

module("resty.beanstalkd", package.seeall)

_VERSION = "0.01"
local setmetatable = setmetatable
local error = error

local tcp = ngx.socket.tcp
local strlen = string.len
local strsub = string.sub
local strmatch = string.match
local tabconcat = table.concat

local class = resty.beanstalkd
local mt = {__index = class}
module(...)

_VERSION = "0.02"

local mt = { __index = _M }

function new(self)
local sock, err = tcp()
Expand Down Expand Up @@ -160,7 +162,11 @@ function close(self)
return sock:close()
end

-- to prevent use of casual module global variables
getmetatable(class).__newindex = function (table, key, val)
error("attempt to write to undeclared variable " .. key .. "")
end
local class_mt = {
-- to prevent use of casual module global variables
__newindex = function (table, key, val)
error('attempt to write to undeclared variable "' .. key .. '"')
end
}

setmetatable(_M, class_mt)

0 comments on commit 62e3cc0

Please sign in to comment.