ttyhue 0.1.0 → 0.1.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/CHANGELOG.md +8 -0
- data/lib/ttyhue/colorizer.rb +2 -2
- data/lib/ttyhue/parser/color_tag.rb +0 -2
- data/lib/ttyhue/parser.rb +6 -2
- data/lib/ttyhue/version.rb +1 -1
- data/lib/ttyhue.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a87fe9928772a8b47f04fd044edf1ffd9ddc412c6d844480dc195b3d4b8c9840
|
4
|
+
data.tar.gz: 3d697a8759a4028b70136d25bd76d9f84821a20287e97d4201dc78a33cc59802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df7735cadaa236596343b9efc7e0cc23d8b1f39a69766ef5badf3ddbdad8f15e72511964883c310c1c9506455d6b7961e9d6a69f3a8b25bf37d86a77f89a373
|
7
|
+
data.tar.gz: 5524e9b1ef604e7d610e909e42e952e0d077a252ac881a7dd22386998b12d4687c7393ecb841cd29f7649794c8fab7c657d084c1323482b4689b817b89a85f95
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.2] - 2022-10-05
|
4
|
+
|
5
|
+
- Enable passing styles directly to TTYHue.c method
|
6
|
+
|
7
|
+
## [0.1.1] - 2022-10-05
|
8
|
+
|
9
|
+
- Fixed parser bug, where row of color tags as well as unclosed tags were not handled gracefully
|
10
|
+
|
3
11
|
## [0.1.0] - 2022-10-04
|
4
12
|
|
5
13
|
- Initial release
|
data/lib/ttyhue/colorizer.rb
CHANGED
data/lib/ttyhue/parser.rb
CHANGED
@@ -7,7 +7,8 @@ module TTYHue
|
|
7
7
|
|
8
8
|
TOKENS = {
|
9
9
|
tag: /{[^{}]+}/,
|
10
|
-
content: /[^{]
|
10
|
+
content: /[^{]+/,
|
11
|
+
unclosed_tag: /{[^{]*/
|
11
12
|
}
|
12
13
|
|
13
14
|
class ParseError < StandardError; end
|
@@ -23,7 +24,10 @@ module TTYHue
|
|
23
24
|
scanner = StringScanner.new(@string)
|
24
25
|
until scanner.eos?
|
25
26
|
next if handle_content!(scanner.scan(TOKENS[:content]))
|
26
|
-
|
27
|
+
while str = scanner.scan(TOKENS[:tag])
|
28
|
+
handle_tag!(str)
|
29
|
+
end
|
30
|
+
next if handle_content!(scanner.scan(TOKENS[:unclosed_tag]))
|
27
31
|
end
|
28
32
|
flattened_result
|
29
33
|
end
|
data/lib/ttyhue/version.rb
CHANGED
data/lib/ttyhue.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ttyhue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Sito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|