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