./devel/lua-penlight, Lua libraries for functional programming, OS path management, etc

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]

Branch: CURRENT, Version: 1.7.0, Package name: lua53-penlight-1.7.0, Maintainer: pkgsrc-users

A set of pure Lua libraries focusing on input data handling (such as
reading configuration files), functional programming (such as map,
reduce, placeholder expressions,etc), and OS path management. Much
of the functionality is inspired by the Python standard libraries.

Required to run:
[devel/lua-filesystem] [lang/lua53]

Required to build:

Master sites:

Version history: (Expand)

CVS history: (Expand)

   2020-07-02 12:26:19 by Nia Alarie | Files touched by this commit (29)
Log message:
Add 'lua' category to Lua modules.

While here, normalize some packages with strange variable order.
   2020-02-15 06:50:37 by Makoto Fujiwara | Files touched by this commit (2) | Package updated
Log message:
(devel/lua-penlight) Updated 1.5.4 to 1.7.0

## 1.7.0 (2019-10-14)
### New features

  - `utils.quote_arg` will now optionally take an array of arguments and escape
    them all into a single string.
  - `app.parse_args` now accepts a 3rd parameter with a list of valid flags and \ 
  - `app.script_name` returns the name of the current script (previously a \ 
private function)

### Changes

  - Documentation updates
  - `utils.quit`: exit message is no longer required, and closes the Lua state \ 
(on 5.2+).
  - `utils.assert_arg` and `utils.assert_string`: now return the validated value
  - `pl.compat`: now exports the `jit` and `jit52` flags
  - `pretty.write`: now sorts the output for easier diffs \ 

### Fixes

  - `utils.raise` changed the global `on_error`-level when passing in bad arguments
  - `utils.writefile` now checks and returns errors when writing
  - `compat.execute` now handles the Windows exitcode -1 properly
  - `types.is_empty` would return true on spaces always, indepedent of the parameter
  - `types.to_bool` will now compare case-insensitive for the extra passed strings
  - `app.require_here` will now properly handle an absolute base path
  - `stringx.split` will no longer append an empty match if the number of requested
    elements has already been reached \ 
  - `path.common_prefix` and `path.relpath` return the result in the original casing
    (only impacted Windows) [#297](https://github.com/Tieske/Penlight/pull/297)
  - `dir.copyfile`, `dir.movefile`, and `dir.makepath` create the new file/path with
    the requested casing, and no longer force lowercase (only impacted Windows)
  - added a missing assertion on `path.getmtime` \ 
  - `stringx.rpartition` returned bad results on a not-found \ 

## 1.6.0 (2018-11-23)
### New features

  - `pl.compat` now provides `unpack` as `table.unpack` on Lua 5.1

### Changes

  - `utils.unpack` is now documented and respects `.n` field of its argument.
  - `tablex.deepcopy` and `tablex.deepcompare` are now cycle aware (#262)
  - Installing through LuaRocks will now include the full rendered documentation

### Fixes

  - Fixed `seq.last` returning `nil` instead of an empty list when given an \ 
empty iterator (#253).
  - `pl.template` now applies `tostring` when substituting values in templates, \ 
avoiding errors when they are not strings or numbers (#256).
  - Fixed `pl.import_into` not importing some Penlight modules (#268).
  - Fixed version number stuck at 1.5.2 (#260).
  - Fixed `types.is_empty` returning `true` on tables containing `false` key (#267).
  - Fixed `test.assertraise` throwing an error when passed an array with a \ 
function to call plus its arguments (#272).
  - Fixed `test.assertraise` not throwing an error when given function does not \ 
error but instead returns a string matching given error pattern.
  - Fixed placeholder expressions being evaluated with wrong precedence of \ 
binary and unary negation.
  - Fixed placeholder expressions being evaluated assuming wrong binary operator \ 
associativity (e.g. `_1-(_2+_3)` was evaluated as `(_1-_2)+_3`.
  - Fixed placeholder expressions being evaluated as if unary operators take \ 
precedence over power operator (e.g. `(-_1)^_2`) was evaluated as `-(_1^2)`).
  - Fixed vulnerable backtracking pattern in `pl.stringx.strip` (#275)
   2020-01-19 00:36:14 by Roland Illig | Files touched by this commit (3046)
Log message:
all: migrate several HOMEPAGEs to https

pkglint --only "https instead of http" -r -F

With manual adjustments afterwards since pkglint 19.4.4 fixed a few
indentations in unrelated lines.

This mainly affects projects hosted at SourceForce, as well as
freedesktop.org, CTAN and GNU.
   2017-09-16 21:53:51 by Alexander Nasonov | Files touched by this commit (13)
Log message:
Drop maintainership.
   2017-09-10 17:25:14 by Alexander Nasonov | Files touched by this commit (2) | Package updated
Log message:
Update devel/lua-penlight to version 1.5.4.

Commits between 1.5.2 and 1.5.4:

* change compat.execute to behave similarly on Lua 5.1 and Lua > 5.1.
* Issue #246: bad/misleading code in examples
* Issue #245 document 'optional'
* split the templating engine in a compile and render step
  backward compatible. Minor caveat is that it introduces
  2 local variables in the template, but chances of name collissions
  are very low.
  Additionally: reduced the string concatenation. Only one concat call
  is left.
* Merge pull request #249 from Tieske/feat/reuse-template
  split the templating engine in a compile and render step
* updated template module
  - added the newline option (for single line output)
  - merged test files: test-template and test-substitute
  - changed compile signature to take a table of options
  - improved error reporting: syntax errors report error + code
* Fix global success variable in lapp.
* Added more tests for seq.last
* Minor refactor of seq.last and fixes corner case of
  an empty source stream as outlined in issue #252.
* Added tests for List.put, remove, len, clear and contains.
* Added tests for List.split.
* Added tests for List.partition.
* Added missing tests for List.range, reduce and foreach.
* feat(template): handle special case of a constant string
  A common scenario is an 'option' for templates, where most
  of the use is without it. This change optimizes the render
  function in case of constant strings
* Fix error in 'pl.lapp.process_options_string'
  Fix error "attempt to concatenate a nil value (local 'vtype')" by
  checking making sure vtype is not nil.
* Merge pull request #250 from Tieske/feat/improve-template
  feat(template) newline option, better error reporting, cleanup
* Merge pull request #255 from doronbehar/patch-1
  Fix error in 'pl.lapp.process_options_string'
* bump version to 1.5.3
* Merge pull request #244 from bungle/master
  change compat.execute to behave similarly on Lua 5.1 and Lua > 5.1.
* Merge pull request #251 from IoriBranford/master
  Fix global success variable in lapp process_default.
* Merge pull request #254 from greatwolf/list_coverage
  List coverage
   2017-04-27 23:52:09 by Alexander Nasonov | Files touched by this commit (2) | Package updated
Log message:
Update devel/lua-penlight to 1.5.2.

Changes between 1.5.2 and 1.4.1:

    lapp: print left in code
    issue #228: bug in file matching for dir.getfiles
    issue #243 broken lapp default: little fix to c222e422274c
    testclone example assumed global lfs
    update changes and version number
    issue #226: can use either = or : to separate flag/value
    issue #241: little hack to handle no-trailing-comment case
    Merge pull request #193 from jvprat/class_tostring

    Setup __tostring on class creation instead of per instance.
    Merge pull request #240 from urzds/fix/lapp-convert-defaults

    lapp: Convert default values using the associated converter function
    Merge pull request #242 from tjachmann/workaround-for-pretty.load-error

    Workaround for error in pretty.load with a C hook

    pretty.load errors out, if a C hook function is installed (Lua 5.1). Reason: \ 
debug.gethook() returns a string as first return value in this case.  Then \ 
debug.sethook complains about the first argument being a string not a function.
    lapp: Convert default values using the associated converter function

    Also uses quite some hack to catch errors during conversion of default values.
     This prevents the application from quitting, if the value provided as default
     would be invalid in the current context, while the value provided on the
     command line is valid.

    Also handles -h and --help early, before parsing command line arguments
     Otherwise it would be impossible to show the help, if conversion of the
     default value of some argument fails.
    Merge pull request #239 from kulla/rename-arg-pattern

    dir.lua: Rename arg "pattern" to "shell_pattern"

    Fix a test to pass under LuaJIT with Lua 5.2 compat
    Merge pull request #237 from Tieske/fix/execute

    fix os.execute
    Merge branch 'master' of https://github.com/stevedonovan/Penlight into \ 
    fix os.execute to return proper results when LuaJIT is being used with 52 \ 
compatibility enabled
    Tweak local declaration in pl.compat

    Avoid duplicated variable.
    Fix a typo in pl.seq docs [ci skip]
    Merge pull request #233 from greatwolf/seq_coverage

    Added more test coverage for pl.seq
    Added test for seq.printall.
    Minor refactor of existing test.
    Added missing test case for equal_to and random.
    Added tests for seq.random, minmax, enum and copy_tuples.
    seq coverage
    Merge pull request #231 from greatwolf/bugfix_refactor

    Redid PR #230 as a separate branch.
    Added more tests for seq.reduce.
    Fixed seq.reduce to handle empty case.
    Allow passing initial value when calling reduce through seq object.
    naming consistency.
    redundant checks.
    Update version number in docs
    Fix typos in pl.lapp docs
    Added tests for seq.take.
    Just use n as counter.
    Added tests for seq.skip.
    Fixed bug when skipping past list.
    More concise code.

    Initial value argument for `tablex.reduce` is going to be added in 1.5.0, \ 
not 1.3.2
    Merge pull request #213 from gpleiss/reduce-memo

    tablex.reduce can take an optional initial memo
    tablex.reduce can take an optional initial memo
    Add "in progress" changes [ci skip]
    Merge pull request #221 from mpeterv/fix-stringx-splitlines

    Fix stringx.splitlines
    Fix coverage reporting on travis

    Tests are now run from project root.
    pl.seq() constructor can take an iterator which returns a function _and_ an \ 
    issue #226 lapp respects ':' as well as '='
    Merge pull request #225 from kulla/dir-some-fixes

    Little fixes in dir.lua
    dir.lua: Replace tab with whitespace in docstring.

    The tab characters create a strange format in documentatio (cf.
    https://stevedonovan.github.io/Penlight … etallfiles

    dir.lua: Remove file execution permission.

    Merge pull request #224 from kulla/utils-doctring-fix

    Fix usage example of string_lambda().
    utils.lua: Fix usage example of string_lambda().

    Update docs for template.substitute
    Merge pull request #222 from urzds/feature/template-customisable-filename

    pl.template: Support customising the chunk "filename" (default: TMP)
    pl.template: Support customising the chunk name (default: "TMP")

    This can be used to aid debugging, e.g. when the template resides in an actual
    Fix handling of __index returning false in pl.strict

    Ref #223.
    Add a test for tablex.count_map
    Merge pull request #214 from urzds/feat/customisable-inline-escape

    pl.template: Support customising the inline escape character (default…
    pl.data: faster delimiter guessing

    Don't count occurrences of potential delims, just use string.find.
    Fix error in tablex.count_map

    Regression introduced in @6123f9e.
    Remove unused localizations, update dependency lists
    Don't use globals in 'pl.data' tests
    Fix stringx.splitlines

    Make stringx.splitlines more compliant with its Python

    * Recognize "\r\n" as a single line end.
    * Return an empty list for an empty string.
    * Implement `keep_ends` argument.
   2016-11-20 11:37:50 by Alexander Nasonov | Files touched by this commit (2) | Package updated
Log message:
Update devel/lua-penlight to version 1.4.1.

Prompted by beta.repology.org.

## 1.4.1

### Changes

  - All functions that return instances of `pl.List`, `pl.Map` and
    `pl.Set` now require corresponding modules, so that their methods
    always work right away.

### Fixes

  - Fixed `dir.getallfiles` returning an empty array when called
    without `pattern` argument.

## 1.4.0

### Changes

### Fixes

  - `pl.path` covers edge cases better (e.g 'path.normpath` was broken)
  - `p.dir` shell patterns fixed
  - `os.tmpname` broken on modern Windows/MSVC14
  - (likewise for `utils.executeex` which depends on it)
  - `pretty.write` more robust and does not lose floating-point precision;
    saves and restores debug hooks when loading.
  - `pl.lexer` fixes: `cpp` lexer now filters space by default
  - `tablex.sortv` no longer assumes that the values are all unique
  - `stringx.center` is now consistent with Python; `stringx.rfind` and
  `string.quote_string` fixed.
  - `data.write` had a problem with default delimiter, properly
    returns error now.
  - `pl.Set` `+` and `-` now have correct semantics

### Features

  - `pl.tablex` has `union` and `merge` convenience functions
  - `pl.lapp` understands '--' meaning end of parsed arguments
  - `utils.quote_arg` quotes command arguments for `os.execute`,
    correctly handling all special characters.
  - `utils.writefile` has optional `is_bin` argument
  - 'pl.lexer' supports line numbers with string argument
  - `stringx.endswith` may be passed an array of possible suffixes.
  - `data.read` - in CSV mode, assume empty fields are numerical zero
   2016-01-30 11:52:43 by Alexander Nasonov | Files touched by this commit (1)
Log message:
Add devel/lua-filesystem dependency.