From e87b06ee0fe2a588b72a356bbb8378899365d626 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 5 Jul 2020 17:18:56 -0400 Subject: Add rockspec Add a rockspec and move the files around so that luarocks can install it correctly --- ext.lua | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 ext.lua (limited to 'ext.lua') diff --git a/ext.lua b/ext.lua deleted file mode 100644 index 1c05b9f..0000000 --- a/ext.lua +++ /dev/null @@ -1,38 +0,0 @@ ---[[ -Extensions that don't belong anywhere else -]] - --- Override tostring to display more info about the table -local old_tostring = tostring -local numtabs = 0 -local printed_tables = {} -function tostring(el) - if type(el) == "table" and printed_tables[el] == nil then - printed_tables[el] = true - numtabs = numtabs + 1 - local strbuilder = {"{"} - for k,v in pairs(el) do - strbuilder[#strbuilder + 1] = string.format("%s%s : %s", string.rep("\t",numtabs), tostring(k), tostring(v)) - end - printed_tables[el] = nil - strbuilder[#strbuilder + 1] = string.rep("\t",numtabs - 1) .. "}" - numtabs = numtabs - 1 - return table.concat(strbuilder,"\n") - end - return old_tostring(el) -end - ---functions to save my hand -function assertf(bool,msg,...) - if not bool then - error(string.format(msg,...),2) - end -end - -function errorf(fmt,...) - error(string.format(fmt,...),2) -end - -function printf(fmt,...) - print(string.format(fmt,...)) -end -- cgit v1.2.3-70-g09d2