Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Nov 13, 2023
1 parent c345239 commit 8b6a4c9
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<br/>
`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:<br/>
`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

Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ build_script:
- luarocks make

test_script:
- busted
- busted --Xoutput "--color"
11 changes: 10 additions & 1 deletion doc_topics/01-introduction.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions src/environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b6a4c9

Please sign in to comment.