hslua-module-system 1.2.1.1 → 1.2.2
raw patch · 3 files changed
+19/−3 lines, 3 filesdep +hslua-list
Dependencies added: hslua-list
Files
- CHANGELOG.md +7/−0
- hslua-module-system.cabal +2/−1
- src/HsLua/Module/System.hs +10/−2
CHANGELOG.md view
@@ -2,6 +2,13 @@ `hslua-module-system` uses [PVP Versioning][]. +## hslua-module-system-1.2.2++Released 2025-08-09.++- Lists of file paths now have a "FilePath list" metatable that+ add list methods.+ ## hslua-module-system-1.2.1.1 Released 2025-07-23.
hslua-module-system.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hslua-module-system-version: 1.2.1.1+version: 1.2.2 synopsis: Lua module wrapper around Haskell's System module. description: Provides access to system information and@@ -39,6 +39,7 @@ default-language: Haskell2010 build-depends: base >= 4.11 && < 5 , hslua-core >= 2.1 && < 2.4+ , hslua-list >= 1.1 && < 1.2 , hslua-packaging >= 2.3 && < 2.4 default-extensions: LambdaCase , OverloadedStrings
src/HsLua/Module/System.hs view
@@ -52,6 +52,7 @@ import Data.Text (Text) import Data.Version (versionBranch) import HsLua.Core+import HsLua.List (newListMetatable) import HsLua.Marshalling import HsLua.Packaging import HsLua.Module.SystemUtils@@ -294,7 +295,7 @@ <#> opt (stringParam "directory" ("Path of the directory whose contents should be listed. " `T.append` "Defaults to `.`."))- =#> functionResult (pushList pushString) "table"+ =#> functionResult (pushFilePathList pushString) "table" ("A table of all entries in `directory`, except for the " `T.append` "special entries (`.` and `..`).") #? "List the contents of a directory."@@ -564,7 +565,7 @@ <#> opt (filepathParam "filepath" ("relative path that is appended to the path; ignored " <> "if the result is a list of search paths."))- =#> functionResult (either pushString (pushList pushString))+ =#> functionResult (either pushString (pushFilePathList pushString)) "string|{string,...}" "Either a single file path, or a list of search paths." #? T.unlines@@ -649,3 +650,10 @@ (\s -> fromMaybe s $ T.stripPrefix "xdg" s) . T.filter (/= '_') . T.toLower++-- | Pushes a list of file paths.+pushFilePathList :: LuaError e => Pusher e [FilePath]+pushFilePathList fps = do+ pushList pushString fps+ newListMetatable "FilePath list" (pure ())+ setmetatable (nth 2)