diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | valua.lua | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml index 525a299..3cd431f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,8 @@ install: - luarocks install luacheck - luarocks install luacov-coveralls -script: - - luacheck --codes --std=max *.lua +script: + - luacheck --codes --std=max *.lua --ignore 211/_ENV - lua valua-test.lua after_success: @@ -1,4 +1,4 @@ -##Valua - Validation for Lua +## Valua - Validation for Lua [![Build Status](https://travis-ci.org/sailorproject/valua.svg?branch=master)](https://travis-ci.org/sailorproject/valua) [![Coverage Status](https://coveralls.io/repos/github/sailorproject/valua/badge.svg?branch=master)](https://coveralls.io/github/sailorproject/valua?branch=master) @@ -15,7 +15,7 @@ Valua is also available through luarocks luarocks install valua ```` -####Usage +#### Usage Example 1 - Just create, chain and use: ```lua valua:new().type("string").len(3,5)("test string!") -- false, "should have 3-5 characters" @@ -27,7 +27,7 @@ reusable_validation("test string!") -- false, "should have 3-5 characters" reusable_validation("test!") -- true ``` -####Current validation functions +#### Current validation functions * alnum() - Checks if string is alphanumeric. @@ -19,13 +19,15 @@ -- reusable_validation("test!") -- true -- -local valua = {} - local tinsert,setmetatable,len,match,tonumber = table.insert,setmetatable,string.len,string.match,tonumber local next,type,floor,ipairs = next,type,math.floor, ipairs local unpack = unpack or table.unpack local pack = table.pack or function(...) return { n = select('#', ...), ... } end +local _ENV = nil + +local valua = {} + -- CORE -- Caution, this is confusing |