woad 0.0.0 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHORS.md +3 -3
- data/CHANGES.md +17 -0
- data/CONTRIBUTING.md +36 -0
- data/EXAMPLES.md +8 -0
- data/FAQ.md +28 -0
- data/INSTALL.md +43 -0
- data/NEWS.md +10 -0
- data/README.md +48 -10
- data/SECURITY.md +22 -0
- data/TODO.md +6 -2
- data/examples/print_status.md +35 -0
- data/examples/print_status.rb +11 -0
- data/lib/woad/version.rb +3 -3
- data/lib/woad.rb +49 -2
- data/test/unit/tc_codes.rb +42 -0
- data/test/unit/ts_all.rb +12 -0
- metadata +13 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13931221630333301aaa33438eccb58a62c6d1156961ac89af48ccf53a203871
|
|
4
|
+
data.tar.gz: fd74e7d8ffc6e32f58ee993f9763cd84fec7a98293c42af222771e0be202ddd9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43731235a106d8ec4e905f90c3cfe1531348882499c8e2895e9e5c50b1074ae54bb3a9170438c6c6124b4cdb2565061231301b413b54adf316502ec238cf4757
|
|
7
|
+
data.tar.gz: 060fc1e463fa0e8307872ee8ec77dc6ebf53290cc3de07fa5d02016a377b75ab2ef01cd1029d464e891490dd5d3d386a4eca121ccc1f4da082fc986adc530f37
|
data/AUTHORS.md
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
## Defect reports, fixes and suggestions (for which we are very grateful)
|
|
12
12
|
|
|
13
|
-
| Name
|
|
14
|
-
|
|
|
15
|
-
| \<none>
|
|
13
|
+
| Name | GitHub |
|
|
14
|
+
| ----------- | --------------------------------- |
|
|
15
|
+
| \<none> | |
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
Contributions are welcomed.
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# woad.Ruby - Changes <!-- omit in toc -->
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## 0.0.2 - 19th August 2026
|
|
5
|
+
|
|
6
|
+
* **EXAMPLES.md** catalog and **examples/print_status**;
|
|
7
|
+
* reordered **README.md** (canonical sections; **Examples**; **Dependencies** Efferent / Afferent); dropped GitHub-release badge;
|
|
8
|
+
* expanded **woad.gemspec** `spec.summary` to the README tagline; packaged **AUTHORS**, **CHANGES**, **CONTRIBUTING**, **EXAMPLES**, **FAQ**, **INSTALL**, **NEWS**, **SECURITY**, and **TODO**;
|
|
9
|
+
* **woad.gemspec**: `required_ruby_version` is the range `>= 2.0` (dropped `< 5`); **Gemfile.lock** and **.ruby-version** excluded from `spec.files`;
|
|
10
|
+
* **Gemfile** sets `lockfile false` when Bundler supports it; **.gitignore** includes **Gemfile.lock**; CI uses `bundler-cache: false` because Bundler 4 then writes no lockfile and **ruby/setup-ruby** cache cats **Gemfile.lock**;
|
|
11
|
+
* CI **Warnings** job now runs on Ruby **3.4** via **run_all_unit_tests.sh** `--lib --warnings`;
|
|
12
|
+
* added **run_all_unit_tests.sh** (from https://github.com/synesissoftware/misc-dev-scripts) that skips **tput** when **$TERM** is unset or stdout is not a TTY;
|
|
13
|
+
* library source **Home:** URL now uses `https`;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 0.0.1 - 15th August 2026
|
|
17
|
+
|
|
18
|
+
* SGR colour and reset codes (`RESET`, `FG_*`, `BG_*`, including bright variants);
|
|
19
|
+
|
|
20
|
+
|
|
4
21
|
## 0.0.0 - 15th August 2026
|
|
5
22
|
|
|
6
23
|
* initial project scaffolding;
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# woad.Ruby - Contributing <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Defects and features](#defects-and-features)
|
|
7
|
+
- [Pull requests](#pull-requests)
|
|
8
|
+
- [Tests](#tests)
|
|
9
|
+
- [License](#license)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Defects and features
|
|
13
|
+
|
|
14
|
+
Open an issue on https://github.com/synesissoftware/woad.Ruby/issues.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Pull requests
|
|
18
|
+
|
|
19
|
+
Pull requests are welcome on https://github.com/synesissoftware/woad.Ruby. Keep diffs local to the change; match existing indentation (2 spaces in Ruby) and the Synesis markdown set (**README.md**, **CHANGES.md**, **NEWS.md**, **TODO.md**, **INSTALL.md**, **CONTRIBUTING.md**, **SECURITY.md**).
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Tests
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
bundle exec rake test
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
or `./run_all_unit_tests.sh`.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
Contributions are accepted under the 3-clause BSD license. See [LICENSE](./LICENSE).
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<!-- ########################### end of file ########################### -->
|
data/EXAMPLES.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# woad.Ruby - Examples <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|Name|Source & Description|Summary|
|
|
4
|
+
|---|---|---|
|
|
5
|
+
|**print_status**|[examples/print_status.rb](./examples/print_status.rb)<br/>[examples/print_status.md](./examples/print_status.md)|Prints sample status words with **woad** SGR colour constants|
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<!-- ########################### end of file ########################### -->
|
data/FAQ.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# woad.Ruby - FAQ <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
The FAQ list is under (constant) development. If you post a question on the
|
|
4
|
+
[Issues](https://github.com/synesissoftware/woad.Ruby/issues) forum
|
|
5
|
+
it will be used to create one.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Table of Contents <!-- omit in toc -->
|
|
9
|
+
|
|
10
|
+
- [Q1: "How do I install this library?"](#q1-how-do-i-install-this-library)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# FAQs: <!-- omit in toc -->
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Q1: "How do I install this library?"
|
|
17
|
+
|
|
18
|
+
Install via **gem**:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
gem install woad
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
See [README.md](./README.md) for usage.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<!-- ########################### end of file ########################### -->
|
data/INSTALL.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# woad.Ruby - Installation and Use <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Install the gem](#install-the-gem)
|
|
7
|
+
- [From a source checkout](#from-a-source-checkout)
|
|
8
|
+
- [Using the library](#using-the-library)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Install the gem
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
gem install woad
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
or add to a **Gemfile**:
|
|
18
|
+
|
|
19
|
+
```Ruby
|
|
20
|
+
gem 'woad'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
then `bundle install`.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## From a source checkout
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
bundle install
|
|
30
|
+
bundle exec rake test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Using the library
|
|
35
|
+
|
|
36
|
+
```Ruby
|
|
37
|
+
require 'woad'
|
|
38
|
+
|
|
39
|
+
puts "#{Woad::FG_GREEN}ok#{Woad::RESET}"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<!-- ########################### end of file ########################### -->
|
data/NEWS.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# woad.Ruby - News <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
| Date | News Item |
|
|
4
|
+
| ---------------- | -------------------------------------------------------------------------------------- |
|
|
5
|
+
| 20th August 2026 | [**woad.Ruby** 0.0.2](https://github.com/synesissoftware/woad.Ruby/releases/tag/0.0.2) |
|
|
6
|
+
| 15th August 2026 | [**woad.Ruby** 0.0.1](https://github.com/synesissoftware/woad.Ruby/releases/tag/0.0.1) |
|
|
7
|
+
| 15th August 2026 | [**woad.Ruby** 0.0.0](https://github.com/synesissoftware/woad.Ruby/releases/tag/0.0.0) |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<!-- ########################### end of file ########################### -->
|
data/README.md
CHANGED
|
@@ -5,7 +5,6 @@ Minimal ANSI terminal colour codes, for Ruby
|
|
|
5
5
|

|
|
6
6
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
7
7
|
[](https://badge.fury.io/rb/woad)
|
|
8
|
-
[](https://github.com/synesissoftware/woad.Ruby/releases/latest)
|
|
9
8
|
[](https://github.com/synesissoftware/woad.Ruby/commits/master)
|
|
10
9
|
[](https://github.com/synesissoftware/woad.Ruby/actions/workflows/ruby.yml)
|
|
11
10
|
|
|
@@ -15,11 +14,17 @@ Minimal ANSI terminal colour codes, for Ruby
|
|
|
15
14
|
- [Introduction](#introduction)
|
|
16
15
|
- [Installation](#installation)
|
|
17
16
|
- [Components](#components)
|
|
17
|
+
- [Examples](#examples)
|
|
18
18
|
- [Project Information](#project-information)
|
|
19
19
|
- [Where to get help](#where-to-get-help)
|
|
20
20
|
- [Contribution guidelines](#contribution-guidelines)
|
|
21
21
|
- [Dependencies](#dependencies)
|
|
22
|
-
- [
|
|
22
|
+
- [Efferent (fan-out)](#efferent-fan-out)
|
|
23
|
+
- [Runtime Dependencies (aka "Normal Dependencies")](#runtime-dependencies-aka-normal-dependencies)
|
|
24
|
+
- [Development Dependencies](#development-dependencies)
|
|
25
|
+
- [Afferent (fan-in)](#afferent-fan-in)
|
|
26
|
+
- [Runtime dependents](#runtime-dependents)
|
|
27
|
+
- [Development dependents](#development-dependents)
|
|
23
28
|
- [Related projects](#related-projects)
|
|
24
29
|
- [License](#license)
|
|
25
30
|
|
|
@@ -28,7 +33,9 @@ Minimal ANSI terminal colour codes, for Ruby
|
|
|
28
33
|
|
|
29
34
|
**woad** provides the smallest useful set of fixed ANSI SGR colour sequences for library authors. It is not a console or TUI framework.
|
|
30
35
|
|
|
31
|
-
**woad.Ruby** is the **Ruby** implementation. It supports **Ruby 2.0
|
|
36
|
+
**woad.Ruby** is the **Ruby** implementation. It supports **Ruby 2.0+**.
|
|
37
|
+
|
|
38
|
+
It has **no dependencies** on any other non-standard library.
|
|
32
39
|
|
|
33
40
|
|
|
34
41
|
## Installation
|
|
@@ -45,12 +52,19 @@ Use via **require**, as in:
|
|
|
45
52
|
|
|
46
53
|
```Ruby
|
|
47
54
|
require 'woad'
|
|
55
|
+
|
|
56
|
+
puts "#{Woad::FG_GREEN}ok#{Woad::RESET}"
|
|
48
57
|
```
|
|
49
58
|
|
|
50
59
|
|
|
51
60
|
## Components
|
|
52
61
|
|
|
53
|
-
**woad.Ruby**
|
|
62
|
+
**woad.Ruby** ships SGR string constants (`RESET`, `FG_*`, `BG_*`, including bright variants). TTY/stream gating and Windows virtual-terminal opt-in are not implemented yet.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## Examples
|
|
66
|
+
|
|
67
|
+
Examples are provided in the ```examples``` directory, along with a markdown description for each. A detailed list TOC of them is provided in [EXAMPLES.md](./EXAMPLES.md).
|
|
54
68
|
|
|
55
69
|
|
|
56
70
|
## Project Information
|
|
@@ -68,19 +82,43 @@ Defect reports, feature requests, and pull requests are welcome on https://githu
|
|
|
68
82
|
|
|
69
83
|
### Dependencies
|
|
70
84
|
|
|
71
|
-
|
|
85
|
+
|
|
86
|
+
#### Efferent (fan-out)
|
|
87
|
+
|
|
88
|
+
Libraries upon which **woad.Ruby** depends:
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
##### Runtime Dependencies (aka "Normal Dependencies")
|
|
92
|
+
|
|
93
|
+
* \<none>;
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
##### Development Dependencies
|
|
97
|
+
|
|
98
|
+
* [**rake**](https://rubygems.org/gems/rake);
|
|
99
|
+
* [**test-unit**](https://rubygems.org/gems/test-unit);
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
#### Afferent (fan-in)
|
|
103
|
+
|
|
104
|
+
Projects that depend on **woad.Ruby**:
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
##### Runtime dependents
|
|
108
|
+
|
|
109
|
+
* \<none>;
|
|
72
110
|
|
|
73
111
|
|
|
74
|
-
|
|
112
|
+
##### Development dependents
|
|
75
113
|
|
|
76
|
-
*
|
|
77
|
-
* [**test-unit**](https://github.com/test-unit/test-unit)
|
|
114
|
+
* \<none>;
|
|
78
115
|
|
|
79
116
|
|
|
80
117
|
### Related projects
|
|
81
118
|
|
|
82
|
-
* [**woad
|
|
83
|
-
* [**woad.
|
|
119
|
+
* [**woad**](https://github.com/synesissoftware/woad/) (**C**);
|
|
120
|
+
* [**woad.Python**](https://github.com/synesissoftware/woad.Python/);
|
|
121
|
+
* [**woad.Rust**](https://github.com/synesissoftware/woad.Rust/);
|
|
84
122
|
|
|
85
123
|
|
|
86
124
|
### License
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# woad.Ruby - Security <!-- omit in toc -->
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Table of Contents <!-- omit in toc -->
|
|
5
|
+
|
|
6
|
+
- [Reporting a vulnerability](#reporting-a-vulnerability)
|
|
7
|
+
- [Supported versions](#supported-versions)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## Reporting a vulnerability
|
|
11
|
+
|
|
12
|
+
Please report security issues privately via GitHub Security Advisories on https://github.com/synesissoftware/woad.Ruby/security, or by opening an issue if an advisory cannot be filed. Do not attach exploit proofs of concept against third-party systems.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Supported versions
|
|
16
|
+
|
|
17
|
+
| Version | Supported |
|
|
18
|
+
| ------- | --------- |
|
|
19
|
+
| 0.0.x | ✅ |
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<!-- ########################### end of file ########################### -->
|
data/TODO.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
## Functional improvements
|
|
5
5
|
|
|
6
|
-
* [
|
|
6
|
+
* [x] ~~~SGR colour and reset codes~~~ ✅;
|
|
7
7
|
* [ ] TTY-conditional colour codes (process and per-stream);
|
|
8
8
|
* [ ] Windows virtual-terminal gating (OS build + `GetConsoleMode`);
|
|
9
9
|
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
|
|
16
16
|
## Packaging improvements
|
|
17
17
|
|
|
18
|
-
*
|
|
18
|
+
* [x] ~~~added **run_all_unit_tests.sh** (from **misc-dev-scripts**) that skips `tput` when `$TERM` is unset or stdout is not a TTY~~~;
|
|
19
|
+
* [x] ~~~**Gemfile** `lockfile false`; gitignore **Gemfile.lock**; CI `bundler-cache: false`~~~;
|
|
20
|
+
* [x] ~~~gemspec polish: README tagline as `spec.summary`, drop `< 5` upper bound, package docs, exclude **Gemfile.lock** / **.ruby-version**~~~;
|
|
21
|
+
* [x] ~~~README canonical structure (tagline before badges; **Dependencies**; CI badge → **ruby.yml**); added **examples/print_status**~~~;
|
|
22
|
+
* [x] ~~~after the packaging/boilerplate/CI baseline: bump **VERSION** and align **CHANGES**/**NEWS**~~~;
|
|
19
23
|
|
|
20
24
|
|
|
21
25
|
<!-- ########################### end of file ########################### -->
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# woad.Ruby - Example - **print_status**
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Prints sample status words using **woad** SGR foreground constants and **RESET**.
|
|
6
|
+
|
|
7
|
+
## Source
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
|
|
11
|
+
#! /usr/bin/env ruby
|
|
12
|
+
|
|
13
|
+
# examples/print_status.rb
|
|
14
|
+
|
|
15
|
+
require 'woad'
|
|
16
|
+
|
|
17
|
+
puts "#{Woad::FG_GREEN}ok#{Woad::RESET}"
|
|
18
|
+
puts "#{Woad::FG_YELLOW}warn#{Woad::RESET}"
|
|
19
|
+
puts "#{Woad::FG_RED}error#{Woad::RESET}"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
On a colour-capable terminal the words appear in green, yellow, and red, then the SGR state is reset.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
When run, this produces the following output (colours omitted here):
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
ok
|
|
30
|
+
warn
|
|
31
|
+
error
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<!-- ########################### end of file ########################### -->
|
data/lib/woad/version.rb
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
# Purpose: Version for woad.Ruby library
|
|
6
6
|
#
|
|
7
7
|
# Created: 15th August 2026
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 20th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/woad.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
module Woad
|
|
51
51
|
|
|
52
52
|
# Current version of the woad.Ruby library
|
|
53
|
-
VERSION = '0.0.
|
|
53
|
+
VERSION = '0.0.2'
|
|
54
54
|
|
|
55
55
|
private
|
|
56
56
|
# @!visibility private
|
data/lib/woad.rb
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
# Purpose: Primary require for woad.Ruby library
|
|
6
6
|
#
|
|
7
7
|
# Created: 15th August 2026
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 19th August 2026
|
|
9
9
|
#
|
|
10
|
-
# Home:
|
|
10
|
+
# Home: https://github.com/synesissoftware/woad.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
|
@@ -50,6 +50,53 @@
|
|
|
50
50
|
## Root module for *woad*
|
|
51
51
|
module Woad
|
|
52
52
|
|
|
53
|
+
# Reset
|
|
54
|
+
|
|
55
|
+
RESET = "\e[0m"
|
|
56
|
+
|
|
57
|
+
# Foreground (standard)
|
|
58
|
+
|
|
59
|
+
FG_BLACK = "\e[30m"
|
|
60
|
+
FG_RED = "\e[31m"
|
|
61
|
+
FG_GREEN = "\e[32m"
|
|
62
|
+
FG_YELLOW = "\e[33m"
|
|
63
|
+
FG_BLUE = "\e[34m"
|
|
64
|
+
FG_MAGENTA = "\e[35m"
|
|
65
|
+
FG_CYAN = "\e[36m"
|
|
66
|
+
FG_WHITE = "\e[37m"
|
|
67
|
+
|
|
68
|
+
# Foreground (bright)
|
|
69
|
+
|
|
70
|
+
FG_BRIGHT_BLACK = "\e[90m"
|
|
71
|
+
FG_BRIGHT_RED = "\e[91m"
|
|
72
|
+
FG_BRIGHT_GREEN = "\e[92m"
|
|
73
|
+
FG_BRIGHT_YELLOW = "\e[93m"
|
|
74
|
+
FG_BRIGHT_BLUE = "\e[94m"
|
|
75
|
+
FG_BRIGHT_MAGENTA = "\e[95m"
|
|
76
|
+
FG_BRIGHT_CYAN = "\e[96m"
|
|
77
|
+
FG_BRIGHT_WHITE = "\e[97m"
|
|
78
|
+
|
|
79
|
+
# Background (standard)
|
|
80
|
+
|
|
81
|
+
BG_BLACK = "\e[40m"
|
|
82
|
+
BG_RED = "\e[41m"
|
|
83
|
+
BG_GREEN = "\e[42m"
|
|
84
|
+
BG_YELLOW = "\e[43m"
|
|
85
|
+
BG_BLUE = "\e[44m"
|
|
86
|
+
BG_MAGENTA = "\e[45m"
|
|
87
|
+
BG_CYAN = "\e[46m"
|
|
88
|
+
BG_WHITE = "\e[47m"
|
|
89
|
+
|
|
90
|
+
# Background (bright)
|
|
91
|
+
|
|
92
|
+
BG_BRIGHT_BLACK = "\e[100m"
|
|
93
|
+
BG_BRIGHT_RED = "\e[101m"
|
|
94
|
+
BG_BRIGHT_GREEN = "\e[102m"
|
|
95
|
+
BG_BRIGHT_YELLOW = "\e[103m"
|
|
96
|
+
BG_BRIGHT_BLUE = "\e[104m"
|
|
97
|
+
BG_BRIGHT_MAGENTA = "\e[105m"
|
|
98
|
+
BG_BRIGHT_CYAN = "\e[106m"
|
|
99
|
+
BG_BRIGHT_WHITE = "\e[107m"
|
|
53
100
|
end # module Woad
|
|
54
101
|
|
|
55
102
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#! /usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), '../../lib')
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
require 'woad'
|
|
7
|
+
|
|
8
|
+
require 'test/unit'
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Test_codes < Test::Unit::TestCase
|
|
12
|
+
|
|
13
|
+
def test_RESET
|
|
14
|
+
|
|
15
|
+
assert_equal "\e[0m", Woad::RESET
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_FG_RED
|
|
19
|
+
|
|
20
|
+
assert_equal "\e[31m", Woad::FG_RED
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def test_BG_BLUE
|
|
24
|
+
|
|
25
|
+
assert_equal "\e[44m", Woad::BG_BLUE
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def test_codes_are_csi_sgr
|
|
29
|
+
|
|
30
|
+
[
|
|
31
|
+
Woad::RESET,
|
|
32
|
+
Woad::FG_BLACK,
|
|
33
|
+
Woad::FG_BRIGHT_WHITE,
|
|
34
|
+
Woad::BG_BLACK,
|
|
35
|
+
Woad::BG_BRIGHT_WHITE,
|
|
36
|
+
].each do |code|
|
|
37
|
+
|
|
38
|
+
assert code.start_with?("\e[")
|
|
39
|
+
assert code.end_with?('m')
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
data/test/unit/ts_all.rb
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#! /usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# executes all other tests
|
|
4
|
+
|
|
5
|
+
this_dir = File.expand_path(File.dirname(__FILE__))
|
|
6
|
+
|
|
7
|
+
# all tc_*rb in current directory
|
|
8
|
+
Dir[File.join(this_dir, 'tc_*rb')].each { |file| require file }
|
|
9
|
+
|
|
10
|
+
# all ts_*rb in immediate sub-directories
|
|
11
|
+
Dir[File.join(this_dir, '*', 'ts_*rb')].each { |file| require file }
|
|
12
|
+
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: woad
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Wilson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
Minimal ANSI terminal colour codes, for Ruby.
|
|
@@ -22,13 +22,23 @@ extra_rdoc_files: []
|
|
|
22
22
|
files:
|
|
23
23
|
- AUTHORS.md
|
|
24
24
|
- CHANGES.md
|
|
25
|
+
- CONTRIBUTING.md
|
|
26
|
+
- EXAMPLES.md
|
|
27
|
+
- FAQ.md
|
|
28
|
+
- INSTALL.md
|
|
25
29
|
- LICENSE
|
|
30
|
+
- NEWS.md
|
|
26
31
|
- README.md
|
|
27
32
|
- Rakefile
|
|
33
|
+
- SECURITY.md
|
|
28
34
|
- TODO.md
|
|
35
|
+
- examples/print_status.md
|
|
36
|
+
- examples/print_status.rb
|
|
29
37
|
- lib/woad.rb
|
|
30
38
|
- lib/woad/version.rb
|
|
39
|
+
- test/unit/tc_codes.rb
|
|
31
40
|
- test/unit/tc_version.rb
|
|
41
|
+
- test/unit/ts_all.rb
|
|
32
42
|
homepage: https://github.com/synesissoftware/woad.Ruby
|
|
33
43
|
licenses:
|
|
34
44
|
- BSD-3-Clause
|
|
@@ -46,9 +56,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
46
56
|
- - ">="
|
|
47
57
|
- !ruby/object:Gem::Version
|
|
48
58
|
version: '2.0'
|
|
49
|
-
- - "<"
|
|
50
|
-
- !ruby/object:Gem::Version
|
|
51
|
-
version: '5'
|
|
52
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
60
|
requirements:
|
|
54
61
|
- - ">="
|
|
@@ -59,5 +66,5 @@ rubyforge_project:
|
|
|
59
66
|
rubygems_version: 2.7.6.3
|
|
60
67
|
signing_key:
|
|
61
68
|
specification_version: 4
|
|
62
|
-
summary:
|
|
69
|
+
summary: Minimal ANSI terminal colour codes, for Ruby
|
|
63
70
|
test_files: []
|