--[[ Plugin Name: Assert Function Set Plugin Author: ShadowUK Plugin Version: 1.0a --]] function Assert.ToString(Value) return assert(tostring(Value)) end function Assert.RunString(String) return assert(loadstring(String))() end function Assert.ToNumber(Value) return assert(tonumber(Value)) end function Assert.IsNumber(Value) if (type(Value) == "number") then return true else return false end end function Assert.IsBoolean(Value) if (type(Value) == "boolean") then return true else return false end end function Assert.IsString(Value) if (type(Value) == "string") then return true else return false end end function Assert.IsTable(Value) if (type(Value) == "table") then return true else return false end end function Assert.IsFunction(Value) if (type(Value) == "function") then return true else return false end end function Assert.DoesExsist(Value) if (type(Value) == "nil") then return false else return true end end function Assert.CopyTable(SourceTable) return SourceTable end function Assert.PopulateTable(SourceTable, NumberValues, StringToPopulate) for i = 1, NumberValues do SourceTable[i] = StringToPopulate end end function Assert.CycleTable(SourceTable, CallbackFunction) for k, v in pairs(SourceTable) do CallbackFunction(k, v) end end function Assert.Count(From, To, Callback) for count = From, To do Callback(count, To) end end function Assert.KillProcessTree(ProcessHost) for j, file_path in (System.EnumerateProcesses()) do if (String.Lower(String.SplitPath(file_path).Filename..String.SplitPath(file_path).Extension) == ProcessHost) then System.TerminateProcess(j); end end end function Assert.IsProcessRunning(Process) local Instances = 0; for j, file_path in Window.EnumerateProcesses() do if (String.Lower(String.SplitPath(file_path).Filename..String.SplitPath(file_path).Extension) == Process) then local Instances = Instances + 1 end end return Instances end function Assert.GetOSDate() return os.date("%x") end function Assert.GetLongTime() return os.time() end function Assert.IncludeScriptFolder(FolderPath) for k, v in pairs(File.Find(FolderPath, "*.lua", false, false, nil, nil)) do Application.RunScriptFile(v) end end function Assert.RecurseScriptFolders(FolderPath) for k, v in pairs(File.Find(FolderPath, "*.lua", true, false, nil, nil)) do Application.RunScriptFile(v) end end