diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1bb73..56d1886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,21 +22,20 @@ The scope of what is covered by the version number excludes: - push the commit, and create a release PR - after merging tag the release commit with `vX.Y.Z` - upload to LuaRocks:
- `luarocks upload ./rockspecs/[module-name]-X.Y.Z-1.rockspec --api-key=ABCDEFGH` + `luarocks upload ./rockspecs/luasystem-X.Y.Z-1.rockspec --api-key=ABCDEFGH` - test the newly created rock:
- `luarocks install [module-name]` + `luarocks install luasystem` ## Version history ### Version X.Y.Z, unreleased -- Change: `gettime` is deprecated. Use `unixtime` instead. -- Feat: `unixtime` returns the time since the Unix epoch. -- Feat: `windowstime` returns the time since the Windows epoch. -- Feat: `time` returns the system time. +- Feat: on Windows `sleep` now has a precision parameter - Feat: `setenv` added to set environment variables. - Feat: `getenvs` added to list environment variables. +- Feat: `getenv` added to get environment variable previously set (Windows). - Feat: `random` added to return high-quality random bytes +- Feat: `isatty` added to check if a file-handle is a tty ### Version 0.2.1, released 02-Oct-2016 diff --git a/README.md b/README.md index 3aac3a1..6f3c9f6 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ -LuaSystem -====== - -[![travis-ci status](https://travis-ci.org/o-lim/luasystem.svg?branch=master)](https://travis-ci.org/o-lim/luasystem/builds) +[![Unix build](https://img.shields.io/github/actions/workflow/status/lunarmodules/luasystem/unix_build.yml?branch=master&label=Unix%20build&logo=linux)](https://github.com/lunarmodules/luasystem/actions/workflows/unix_build.yml) +[![AppVeyor build status](https://img.shields.io/appveyor/build/Tieske/luasystem/master?label=Windows%20build&logo=windows)](https://ci.appveyor.com/project/Tieske/luasystem/branch/master) +[![Lint](https://github.com/lunarmodules/luasystem/workflows/Lint/badge.svg)](https://github.com/lunarmodules/luasystem/actions/workflows/lint.yml) +[![SemVer](https://img.shields.io/github/v/tag/lunarmodules/luasystem?color=brightgreen&label=SemVer&logo=semver&sort=semver)](CHANGELOG.md) +# LuaSystem luasystem is a platform independent system call library for Lua. -Supports Lua >= 5.1 and luajit >= 2.0.0. +Supports Unix, Windows, MacOS, `Lua >= 5.1` and `luajit >= 2.0.0`. + +## License and copyright + +See [LICENSE.md](LICENSE.md) + +## Documentation -Currently the following functions are supported: -* gettime -* monotime -* sleep +See [online documentation](https://lunarmodules.github.io/luasystem/) -License -------- +## Changelog & Versioning -This code and its accompanying README are -[MIT licensed](http://www.opensource.org/licenses/mit-license.php). -See LICENSE for details. +See [CHANGELOG.md](CHANGELOG.md) diff --git a/appveyor.yml b/appveyor.yml index 596c846..f39445b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,4 +26,4 @@ build_script: - luarocks make test_script: - - busted + - busted --Xoutput "--color" diff --git a/doc_topics/01-introduction.md b/doc_topics/01-introduction.md index 2359426..9cc2347 100644 --- a/doc_topics/01-introduction.md +++ b/doc_topics/01-introduction.md @@ -1,3 +1,12 @@ # 1. Introduction -A project template to remove the tedious repetitive work of creating Lua modules +luasystem is a platform independent system call library for Lua. +Supports Unix, Windows, MacOS, `Lua >= 5.1` and `luajit >= 2.0.0`. + +Lua is typically platform independent, but it requires adhering to very old C +standards. This in turn means that many common features (according to todays standards) +are not available. This module attempts to overcome some of those hurdles by providing +functions that cover those common needs. + +This is not a kitchen sink library, but a minimalistic one with a focus on platform +independence. diff --git a/src/environment.c b/src/environment.c index 243ed58..67fdeba 100644 --- a/src/environment.c +++ b/src/environment.c @@ -12,8 +12,8 @@ /*** Gets the value of an environment variable. -__NOTE__: Windows has multiple copies of environment variables. This function -will work with Lua's `setenv` on Windows. If you want to use `setenv` then +__NOTE__: Windows has multiple copies of environment variables. The `setenv` function +will not work with Lua's `os.getenv` on Windows. If you want to use `setenv` then consider patching `os.getenv` with this implementation of `getenv`. @function getenv @tparam string name name of the environment variable diff --git a/src/term.c b/src/term.c index 32c0ba5..2adb1e9 100644 --- a/src/term.c +++ b/src/term.c @@ -10,7 +10,7 @@ /*** -Checks if a file is a TTY. +Checks if a file-handle is a TTY. @function isatty @tparam file file the file-handle to check diff --git a/src/time.c b/src/time.c index cfbfe92..5f0ead0 100644 --- a/src/time.c +++ b/src/time.c @@ -103,7 +103,7 @@ Sleep without a busy loop. This function will sleep, without doing a busy-loop and wasting CPU cycles. @function sleep @tparam number seconds seconds to sleep (fractional). -@tparam[opt=16] integer precision minimum stepsize in milliseconds (Windows only) +@tparam[opt=16] integer precision minimum stepsize in milliseconds (Windows only, ignored elsewhere) @return `true` on success, or `nil+err` on failure */ #ifdef _WIN32