-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a complete rewrite, keeping things that worked and discarding some stuff that needs another place to exist. What is gone: - The idea of literate markdowns as a low level testing tool. Testing markdowns using themselves only brough pain. We'll have a more traditional testrunner now, still producing TAP. - All of the code. We'll keep some ideas, but this is being drastically simplified. - MIT licensing. Old code within the branch is still licensed with that one though. What remains: - We try not to negotiate portability. That is our goal, we do this so you don't have to. - We will try to provide first-class tools for working with shell scripting.
- Loading branch information
Showing
56 changed files
with
724 additions
and
2,803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
# Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
# SPDX-License-Identifier: ISC | ||
|
||
# Coral Editor Configuration | ||
# | ||
# These are settings required for a nice and cozy | ||
# formatting of our source. | ||
# | ||
# See http://editorconfig.org/ | ||
# These are settings required for our source. | ||
# | ||
# See http://editorconfig.org/ and make sure you install proper | ||
# support for your editor. | ||
|
||
# Settings for all files | ||
# | ||
# - Unix-style newlines | ||
# - Adds a newline to the end of file if not present | ||
# - Removes trailing spaces from lines | ||
# - Suggests 78 width line lenght (RFC 5322 Section 2.1.1) | ||
# | ||
# - Suggests 78 width line length (RFC 5322 Section 2.1.1) | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
rulers = 78 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
rulers = 78 | ||
|
||
# Settings for shell script files | ||
# | ||
# - Use tabs, required for HEREDOCs to work properly | ||
# - Use a 4-space tab width | ||
# | ||
[*.sh] | ||
indent_style = tab | ||
tab_width = 4 | ||
indent_style = tab | ||
tab_width = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
# SPDX-License-Identifier: ISC | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull7_request: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
Tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: ./entrypoint.sh tap | ||
- run: make docker-matrix | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
Copyright (c) 2017 Alexandre Gaigalas | ||
ISC License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Copyright (c) 2024 Alexandre Gomes Gaigalas <[email protected]> | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
# SPDX-License-Identifier: ISC | ||
|
||
IMAGE = alganet/shell-versions:all | ||
|
||
.PHONY: help docker-matrix | ||
|
||
help: | ||
@echo "Usage: make docker-matrix" | ||
|
||
docker-matrix: | ||
@docker run -t --rm \ | ||
-v $(PWD):/opt/coral \ | ||
-w /opt/coral \ | ||
$(IMAGE) \ | ||
sh test/matrix -c "./entrypoint.sh tap 'test/*/*'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,36 @@ | ||
[#]:# "Copyright (c) Alexandre Gomes Gaigalas <[email protected]>" | ||
[#]:# "SPDX-License-Identifier: ISC" | ||
🐚 coral | ||
======= | ||
======== | ||
|
||
A modest shell script library that _works everywhere_. | ||
a **modular** library to create **portable shell scripts** that run everywhere. | ||
|
||
> We are under _prototype_ development. Things are expected to work just | ||
fine though. | ||
## Introduction | ||
|
||
`coral` is designed to fill strategic gaps in _Shell Script_ by | ||
providing portable libraries that work across [multiple shells](doc/test/common.md). | ||
_coral_ is meant to solve the script portability problem the hard way: by writing reusable code and testing it. | ||
|
||
--- | ||
There is no compilation or build step. Once you download it, you're good to go: | ||
|
||
### [require.sh](doc/spec/require.md) | ||
```sh | ||
./entrypoint.sh help | ||
``` | ||
|
||
A modern module loader with support for circular references and multiple | ||
paths. | ||
# Testing | ||
|
||
All `coral` libraries are exported as reusable modules. | ||
Run all tests locally against the default shell: | ||
|
||
### [spec/doc.sh](doc/spec/spec_doc.md) | ||
```sh | ||
./entrypoint.sh tap | ||
``` | ||
|
||
A [literate](https://en.wikipedia.org/wiki/Literate_programming) test | ||
runner that runs documents written for humans as automated tests. | ||
Run a single test. For example, the pseudoarray implementation: | ||
|
||
It is used to test all `coral` software. | ||
```sh | ||
sh entrypoint.sh tap 'test/_idiom/005-Arr.sh' | ||
``` | ||
|
||
### [module/assemble.sh](doc/spec/module_assemble.md) | ||
|
||
A shell script bundler that can create single executables from multiple | ||
shell sources, supports runtime evaluated code and plays along with | ||
`require.sh`. | ||
|
||
It is used to build the `coral` releases. | ||
|
||
### [lib/dev](doc/spec/lib_dev.md) | ||
|
||
Used to bootstrap the modules, build and develop `coral` applications | ||
from scratch. | ||
|
||
--- | ||
Run all tests inside an ephemeral docker container against all shells: | ||
|
||
```sh | ||
make docker-matrix | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.