File tree Expand file tree Collapse file tree 4 files changed +53
-5
lines changed Expand file tree Collapse file tree 4 files changed +53
-5
lines changed Original file line number Diff line number Diff line change 6
6
7
7
== [Unreleased]
8
8
9
+ == [v0.2.0] - 2022-03-16
10
+
9
11
=== Added
10
12
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.
15
23
16
24
=== Changed
17
25
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`.
19
28
20
29
== [v0.1.0] - 2022-03-06
21
30
Original file line number Diff line number Diff line change 1
1
package = " lgi-async-extra"
2
2
version = " 0.1.0-1"
3
+
3
4
source = {
4
5
url = " git://github.com/sclu1034/lgi-async-extra.git" ,
5
6
tag = " v0.1.0"
6
7
}
8
+
7
9
description = {
8
10
summary = " An asynchronous high(er)-level API wrapper for LGI" ,
9
11
homepage = " https://github.com/sclu1034/lgi-async-extra" ,
10
12
license = " GPLv3"
11
13
}
14
+
12
15
dependencies = {
13
16
" lua >= 5.1" ,
14
17
" lgi" ,
15
18
" async.lua"
16
19
}
20
+
17
21
build = {
18
22
type = " builtin" ,
19
23
modules = {
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change 144
144
145
145
--- Checks if a table is an instance of @{file}.
146
146
--
147
+ -- @since 0.2.0
147
148
-- @usage local File = require("lgi-async-extra.file")
148
149
-- local f = File.new_for_path("/tmp/foo.txt")
149
150
-- assert(File.is_instance(f))
200
201
-- The path is guaranteed to be absolute, by may contain unresolved symlinks.
201
202
-- However, a path may not exist, in which case `nil` will be returned.
202
203
--
204
+ -- @since 0.2.0
203
205
-- @treturn [opt] string
204
206
function File :get_path ()
205
207
return self ._private .f :get_path ()
422
424
-- is `cb(err, stop)`. If `err ~= nil` or a value for `stop` is given, iteration stops
423
425
-- immediately and `cb` will be called.
424
426
--
427
+ -- Changed 0.2.0: Renamed from `read_lines`.
428
+ --
429
+ -- @since 0.2.0
425
430
-- @async
426
431
-- @tparam function iteratee Function to call per line in the file. Signature:
427
432
-- `function(err, line, cb)`
You can’t perform that action at this time.
0 commit comments