Fix references to restia
This commit is contained in:
parent
51fd3673a0
commit
b2e9b224cc
5 changed files with 8 additions and 9 deletions
|
@ -21,7 +21,6 @@ build = {
|
|||
["glass.error"] = "glass/error.lua",
|
||||
["glass.json"] = "glass/json.lua",
|
||||
["glass.lua"] = "glass/lua.lua",
|
||||
["glass.moonhtml"] = "glass/moonhtml.lua",
|
||||
["glass.raw"] = "glass/raw.lua",
|
||||
["glass.skooma.html"] = "glass/skooma/html.lua",
|
||||
["glass.skooma.xml"] = "glass/skooma/xml.lua",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- @module glass.cosmo
|
||||
|
||||
local cosmo = require 'cosmo'
|
||||
local readfile = require 'restia.config.readfile'
|
||||
local raw = require 'glass.raw'
|
||||
|
||||
--- Loads a cosmo template from a file and returns the compiled template.
|
||||
-- Returns nil if no template can be found.
|
||||
|
@ -10,7 +10,7 @@ local readfile = require 'restia.config.readfile'
|
|||
-- @function load
|
||||
return function(name)
|
||||
name = tostring(name) .. '.cosmo'
|
||||
local text = readfile(name)
|
||||
local text = raw(name)
|
||||
if text then
|
||||
return assert(cosmo.compile(text, name))
|
||||
else
|
||||
|
|
|
@ -7,8 +7,8 @@ local csv = require 'streamcsv'
|
|||
-- CSV file is assumed to have a header row.
|
||||
-- @treturn table CSV-Data
|
||||
-- @function load
|
||||
return function(file)
|
||||
local file = io.open(file..'.csv')
|
||||
return function(name)
|
||||
local file = io.open(name..'.csv')
|
||||
if file then
|
||||
return csv.file(file)
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- @module glass.json
|
||||
|
||||
local json = require 'cjson'
|
||||
local readfile = require 'restia.cofnig.readfile'
|
||||
local read = require 'glass.raw'
|
||||
|
||||
--- Loads a JSON-File and returns a corresponding Lua table.
|
||||
-- May return non-table values for invalid JSON,
|
||||
|
@ -11,7 +11,7 @@ local readfile = require 'restia.cofnig.readfile'
|
|||
-- @treturn table JSON-Data
|
||||
-- @function load
|
||||
return function(file)
|
||||
local raw = readfile(file..'.json')
|
||||
local raw = read(file..'.json')
|
||||
if raw then
|
||||
return json.decode(raw)
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
-- @module glass.yaml
|
||||
|
||||
local yaml = require 'lyaml'
|
||||
local readfile = require 'restia.config.readfile'
|
||||
local read = require 'glass.raw'
|
||||
|
||||
--- Loads a YAML-File and returns a corresponding Lua table.
|
||||
-- May return non-table values for invalid YAML,
|
||||
|
@ -11,7 +11,7 @@ local readfile = require 'restia.config.readfile'
|
|||
-- @treturn table YAML-Data
|
||||
-- @function load
|
||||
return function(file)
|
||||
local raw = readfile(file..'.yml') or readfile(file..'.yaml')
|
||||
local raw = read(file..'.yml') or read(file..'.yaml')
|
||||
if raw then
|
||||
return yaml.load(raw)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue