feat: add daw.lua.common.io -- unified I/O wrapper with injectable handles #16
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-common#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Add a unified I/O wrapper to daw-lua-common so no module ever calls
io.* or os.exit() directly. All system I/O goes through one place.
Problem
Currently all DAW programs and modules call io.stderr:write(), print(),
os.exit() etc. directly. When Lua system calls change between versions
(as happened with os.execute in 5.1 vs 5.4), all repos must be searched
and patched. With 80-90 modules planned, this is not acceptable.
Solution
Add
daw.lua.common.iowith injectable handles for testability:Acceptance Criteria
read_line(), flush(), exit()
References
Implemented as daw.common.sys (not a separate daw.lua.common.io module -- title predates the daw.lua.common -> daw.common namespace migration, DAW/daw-lua-common#30). All acceptance criteria met: new(), write(), write_raw(), write_err(), read_line(), flush(), exit(), plus run()/run_rc() beyond the original scope. Default handles io.stdout/io.stderr/io.stdin, injectable via opts table. Covered in test_sys.lua.