handlers.lua

changeset 3
b2df1b3f2c83
parent 2
3975fa5ed630
child 4
4cb0d1dbc65b
equal deleted inserted replaced
2:3975fa5ed630 3:b2df1b3f2c83
4 require("handlers.render") 4 require("handlers.render")
5 require("handlers.copy") 5 require("handlers.copy")
6 require("handlers.ignore") 6 require("handlers.ignore")
7 7
8 local available={ 8 local available={
9 { pattern = "%.page$", handler = handlers.render}, 9 { pattern = "%.lg$", handler = handlers.render},
10 { pattern = "", handler = handlers.copy}, 10 { pattern = "", handler = handlers.copy},
11 } 11 }
12 12
13 13
14 function find(f) 14 function find(f)
15 for _, h in ipairs(available) do 15 for _, h in ipairs(available) do
16 if string.match(h.pattern, f) then 16 if string.match(f, h.pattern) then
17 return h.handler 17 return h.handler
18 end 18 end
19 end 19 end
20 return handlers.ignore 20 return handlers.ignore
21 end 21 end

mercurial