From b2e9b224cc270e25ecfa286b41a4730275d47ec2 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Wed, 8 Mar 2023 11:24:15 +0100 Subject: [PATCH] Fix references to restia --- glass-dev-1.rockspec | 1 - glass/cosmo.lua | 4 ++-- glass/csv.lua | 4 ++-- glass/json.lua | 4 ++-- glass/yaml.lua | 4 ++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/glass-dev-1.rockspec b/glass-dev-1.rockspec index 418d182..c54d911 100644 --- a/glass-dev-1.rockspec +++ b/glass-dev-1.rockspec @@ -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", diff --git a/glass/cosmo.lua b/glass/cosmo.lua index 414f3c4..9f9f7fb 100644 --- a/glass/cosmo.lua +++ b/glass/cosmo.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 diff --git a/glass/csv.lua b/glass/csv.lua index 4000fa2..c409a8f 100644 --- a/glass/csv.lua +++ b/glass/csv.lua @@ -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 diff --git a/glass/json.lua b/glass/json.lua index 64d593c..b651d21 100644 --- a/glass/json.lua +++ b/glass/json.lua @@ -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 diff --git a/glass/yaml.lua b/glass/yaml.lua index af464ce..e863be5 100644 --- a/glass/yaml.lua +++ b/glass/yaml.lua @@ -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