Skip to content

Commit d01577e

Browse files
committed
bump: v0.2.0
1 parent b3f9aa6 commit d01577e

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed

CHANGELOG.adoc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@
66

77
== [Unreleased]
88

9+
== [v0.2.0] - 2022-03-16
10+
911
=== Added
1012

11-
* `file.is_instance`: Static function to check if a value is a file handle
12-
* New module `filesystem`: Utilities for handling directories and other file system properties
13-
* `filesystem.make_directory`: Function to create a directory at a given path
14-
* `filesystem.iterate_contents`: Function to create a directory at a given path
13+
* `file.is_instance`: Static function to check if a value is a file handle.
14+
* `file.create`: Create an empty file.
15+
* `file.read_string`: Read the entire contents of a file into memory. Replaces `file.read_all`.
16+
* `file.read_bytes`: Read the specified number of bytes from the file.
17+
* `file.get_path`: Get the path the file handle points to.
18+
* New module `filesystem`: Utilities for handling directories and other file system properties.
19+
* `filesystem.make_directory`: Create a directory at a given path.
20+
* `filesystem.iterate_contents`: Run a function against the entries of a directory, recursively.
21+
* `filesystem.list_contents`: List the contents of a directory.
22+
* `filesystem.remove_directory`: Remove a directory.
1523

1624
=== Changed
1725

18-
* `file.move`: Now also allows file handlers and instances of `Gio.File` as destination parameter
26+
* `file.move`: Now also allows file handlers and instances of `Gio.File` as destination parameter.
27+
* `file.iterate_lines`: Renamed from `file.read_lines`.
1928

2029
== [v0.1.0] - 2022-03-06
2130

rocks/lgi-async-extra-0.1.0-1.rockspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
package = "lgi-async-extra"
22
version = "0.1.0-1"
3+
34
source = {
45
url = "git://github.com/sclu1034/lgi-async-extra.git",
56
tag = "v0.1.0"
67
}
8+
79
description = {
810
summary = "An asynchronous high(er)-level API wrapper for LGI",
911
homepage = "https://github.com/sclu1034/lgi-async-extra",
1012
license = "GPLv3"
1113
}
14+
1215
dependencies = {
1316
"lua >= 5.1",
1417
"lgi",
1518
"async.lua"
1619
}
20+
1721
build = {
1822
type = "builtin",
1923
modules = {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package = "lgi-async-extra"
2+
version = "0.2.0-1"
3+
4+
source = {
5+
url = "git://github.com/sclu1034/lgi-async-extra.git",
6+
tag = "v0.2.0"
7+
}
8+
9+
description = {
10+
summary = "An asynchronous high(er)-level API wrapper for LGI",
11+
homepage = "https://github.com/sclu1034/lgi-async-extra",
12+
license = "GPLv3"
13+
}
14+
15+
dependencies = {
16+
"lua >= 5.1",
17+
"lgi",
18+
"async.lua"
19+
}
20+
21+
build = {
22+
type = "builtin",
23+
modules = {
24+
["lgi-async-extra.file"] = "src/lgi-async-extra/file.lua",
25+
["lgi-async-extra.stream"] = "src/lgi-async-extra/stream.lua",
26+
},
27+
copy_directories = {
28+
"spec"
29+
}
30+
}

src/lgi-async-extra/file.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ end
144144

145145
--- Checks if a table is an instance of @{file}.
146146
--
147+
-- @since 0.2.0
147148
-- @usage local File = require("lgi-async-extra.file")
148149
-- local f = File.new_for_path("/tmp/foo.txt")
149150
-- assert(File.is_instance(f))
@@ -200,6 +201,7 @@ end
200201
-- The path is guaranteed to be absolute, by may contain unresolved symlinks.
201202
-- However, a path may not exist, in which case `nil` will be returned.
202203
--
204+
-- @since 0.2.0
203205
-- @treturn[opt] string
204206
function File:get_path()
205207
return self._private.f:get_path()
@@ -422,6 +424,9 @@ end
422424
-- is `cb(err, stop)`. If `err ~= nil` or a value for `stop` is given, iteration stops
423425
-- immediately and `cb` will be called.
424426
--
427+
-- Changed 0.2.0: Renamed from `read_lines`.
428+
--
429+
-- @since 0.2.0
425430
-- @async
426431
-- @tparam function iteratee Function to call per line in the file. Signature:
427432
-- `function(err, line, cb)`

0 commit comments

Comments
 (0)