summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNatanael Copa <natanael.copa@gmail.com>2007-11-14 14:17:48 +0000
committerNatanael Copa <natanael.copa@gmail.com>2007-11-14 14:17:48 +0000
commitb4fcb1304664f42f344a724468a3fa6abee3ea4c (patch)
tree022771e6e173d289cecb312faa81b51c802ae225 /lib
parent3b91445eed08aa9548217890a929181ba884c044 (diff)
downloadacf-core-b4fcb1304664f42f344a724468a3fa6abee3ea4c.tar.bz2
acf-core-b4fcb1304664f42f344a724468a3fa6abee3ea4c.tar.xz
removed ed.lua. its unused
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@301 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lib')
-rw-r--r--lib/ed.lua60
1 files changed, 0 insertions, 60 deletions
diff --git a/lib/ed.lua b/lib/ed.lua
deleted file mode 100644
index 2e86f08..0000000
--- a/lib/ed.lua
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/lua
-
-require "object"
-
--- ed object
-Ed = Object:new{
- filename = nil,
- lines = {}
-}
-
-
--- openfile and read it to table
-function Ed:open( filename, mode )
- local f = io.open( filename, mode )
- -- check that open was success
- if f == nil then
- return nil
- end
-
- -- read the lines
- for line in f:lines() do
- table.insert( self.lines, line )
- end
- f:close()
- self.filename = filename
- return self.lines
-end
-
-
--- search and replace on lines that matches linematch
-function Ed:find_gsub( linematch, search, replace, limit )
- local i, line
- for i, line in ipairs( self.lines ) do
- if string.find( line, linematch ) then
- self.lines[i] = string.gsub( line, search, replace, limit )
- end
- end
-end
-
-
--- Write the table to file again
-function Ed:flush( filename )
- local f = io.open( filename, "w" )
- if f == nil then
- return false
- end
-
- -- write each line to file
- for i, line in ipairs( self.lines ) do
- f:write(line .. "\n") -- test this!
- end
- f:close()
- return true
-end
-
-function Ed:insert( line )
- self.lines:insert( line )
-end
-
-