summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-09-25 17:42:43 +0000
committerTed Trask <ttrask01@yahoo.com>2008-09-25 17:42:43 +0000
commitc17faf4b793db95a6957fcf5af7b73acaee2dc76 (patch)
treeb12d81f5e7289c356087f2c98303100d270b3502 /lib
parent233c8fa138a387ae3fd99290db35b0f51eec055e (diff)
downloadacf-core-c17faf4b793db95a6957fcf5af7b73acaee2dc76.tar.bz2
acf-core-c17faf4b793db95a6957fcf5af7b73acaee2dc76.tar.xz
Removed split and join libraries. Join is handled by table.concat. Split is handled by format.string_to_table.
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@1515 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile2
-rw-r--r--lib/README9
-rw-r--r--lib/join.lua25
-rw-r--r--lib/split.lua31
4 files changed, 1 insertions, 66 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 23a1a31..bad3ea5 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -2,7 +2,6 @@ include ../config.mk
LIB_DIST=fs.lua\
html.lua\
- join.lua\
date.lua\
debugs.lua\
format.lua\
@@ -10,7 +9,6 @@ LIB_DIST=fs.lua\
procps.lua\
privsep.lua\
session.lua\
- split.lua\
validator.lua\
web_elements.lua\
authenticator.lua\
diff --git a/lib/README b/lib/README
index 3ed211c..af7df38 100644
--- a/lib/README
+++ b/lib/README
@@ -7,7 +7,7 @@ Also we use Lua Posix for the rest of the functionality.
date.lua - Date and Time functions
fs.lua - File and filesystem library
pidof.lua - Process libraries not provided by LPOSIX
-format.lua - Library to help reformat string,tables,files or any input. Good place for split and join
+format.lua - Library to help reformat strings and tables.
authenticator-plaintext.lua - Used to parse through the username:password file and for permission help
validator.lua - Validate web input for ACF.
@@ -17,10 +17,3 @@ web_elements.lua - More web functionality for ACF.
privsep.lua - Helps with authorization with ACF
session.lua -Helps with Session mangement in ACF
-*** THESE MAY GO AWAY. PUT IN format.lua ***
-
-join.lua - Takes a table and given a delimeter makes it into a string
-*** Added to format.lua as format.table_to_string ***
-split.lua - Take a delimeted string and makes it into a table
-*** Added to format.lua as format.string_to_table ***
-
diff --git a/lib/join.lua b/lib/join.lua
deleted file mode 100644
index e3621de..0000000
--- a/lib/join.lua
+++ /dev/null
@@ -1,25 +0,0 @@
---[[
- module for joining an array to a string
-]]--
-
-module (..., package.seeall)
-
-
--- This code comes from http://lua-users.org/wiki/SplitJoin
---
--- Concat the contents of the parameter list,
--- -- separated by the string delimiter (just like in perl)
--- -- example: strjoin(", ", {"Anna", "Bob", "Charlie", "Dolores"})
-return function (delimiter, list)
- local len = getn(list)
- if len == 0 then
- return ""
- end
- local string = list[1]
- for i = 2, len do
- string = string .. delimiter .. list[i]
- end
- return string
-end
-
-
diff --git a/lib/split.lua b/lib/split.lua
deleted file mode 100644
index f3e2e95..0000000
--- a/lib/split.lua
+++ /dev/null
@@ -1,31 +0,0 @@
---[[
- module for splitting a string to an array
-]]--
-
-module (..., package.seeall)
-
--- This code comes from http://lua-users.org/wiki/SplitJoin
-
--- Split text into a list consisting of the strings in text,
--- separated by strings matching delimiter (which may be a pattern).
--- example: strsplit(",%s*", "Anna, Bob, Charlie,Dolores")
-return function (delimiter, text)
- local list = {}
- local pos = 1
- -- this would result in endless loops
- if string.find("", delimiter, 1) then
- error("delimiter matches empty string!")
- end
- while 1 do
- local first, last = string.find(text, delimiter, pos)
- if first then -- found?
- table.insert(list, string.sub(text, pos, first-1))
- pos = last+1
- else
- table.insert(list, string.sub(text, pos))
- break
- end
- end
- return list
-end
-