Fix references to restia

This commit is contained in:
Talia 2023-03-08 11:24:15 +01:00
parent 51fd3673a0
commit b2e9b224cc
5 changed files with 8 additions and 9 deletions

View file

@ -21,7 +21,6 @@ build = {
["glass.error"] = "glass/error.lua", ["glass.error"] = "glass/error.lua",
["glass.json"] = "glass/json.lua", ["glass.json"] = "glass/json.lua",
["glass.lua"] = "glass/lua.lua", ["glass.lua"] = "glass/lua.lua",
["glass.moonhtml"] = "glass/moonhtml.lua",
["glass.raw"] = "glass/raw.lua", ["glass.raw"] = "glass/raw.lua",
["glass.skooma.html"] = "glass/skooma/html.lua", ["glass.skooma.html"] = "glass/skooma/html.lua",
["glass.skooma.xml"] = "glass/skooma/xml.lua", ["glass.skooma.xml"] = "glass/skooma/xml.lua",

View file

@ -2,7 +2,7 @@
-- @module glass.cosmo -- @module glass.cosmo
local cosmo = require '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. --- Loads a cosmo template from a file and returns the compiled template.
-- Returns nil if no template can be found. -- Returns nil if no template can be found.
@ -10,7 +10,7 @@ local readfile = require 'restia.config.readfile'
-- @function load -- @function load
return function(name) return function(name)
name = tostring(name) .. '.cosmo' name = tostring(name) .. '.cosmo'
local text = readfile(name) local text = raw(name)
if text then if text then
return assert(cosmo.compile(text, name)) return assert(cosmo.compile(text, name))
else else

View file

@ -7,8 +7,8 @@ local csv = require 'streamcsv'
-- CSV file is assumed to have a header row. -- CSV file is assumed to have a header row.
-- @treturn table CSV-Data -- @treturn table CSV-Data
-- @function load -- @function load
return function(file) return function(name)
local file = io.open(file..'.csv') local file = io.open(name..'.csv')
if file then if file then
return csv.file(file) return csv.file(file)
end end

View file

@ -2,7 +2,7 @@
-- @module glass.json -- @module glass.json
local json = require 'cjson' 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. --- Loads a JSON-File and returns a corresponding Lua table.
-- May return non-table values for invalid JSON, -- May return non-table values for invalid JSON,
@ -11,7 +11,7 @@ local readfile = require 'restia.cofnig.readfile'
-- @treturn table JSON-Data -- @treturn table JSON-Data
-- @function load -- @function load
return function(file) return function(file)
local raw = readfile(file..'.json') local raw = read(file..'.json')
if raw then if raw then
return json.decode(raw) return json.decode(raw)
end end

View file

@ -2,7 +2,7 @@
-- @module glass.yaml -- @module glass.yaml
local yaml = require 'lyaml' 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. --- Loads a YAML-File and returns a corresponding Lua table.
-- May return non-table values for invalid YAML, -- May return non-table values for invalid YAML,
@ -11,7 +11,7 @@ local readfile = require 'restia.config.readfile'
-- @treturn table YAML-Data -- @treturn table YAML-Data
-- @function load -- @function load
return function(file) return function(file)
local raw = readfile(file..'.yml') or readfile(file..'.yaml') local raw = read(file..'.yml') or read(file..'.yaml')
if raw then if raw then
return yaml.load(raw) return yaml.load(raw)
end end