aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml4
-rw-r--r--README.md6
-rw-r--r--valua.lua6
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:
diff --git a/README.md b/README.md
index 81710d7..25a44c6 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/valua.lua b/valua.lua
index 4de673b..cf5a536 100644
--- a/valua.lua
+++ b/valua.lua
@@ -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