term-ansicolor 1.10.0 → 1.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.all_images.yml +13 -3
- data/VERSION +1 -1
- data/lib/term/ansicolor/attribute/color256.rb +1 -1
- data/lib/term/ansicolor/attribute/color8.rb +16 -16
- data/lib/term/ansicolor/attribute/intense_color8.rb +32 -34
- data/lib/term/ansicolor/attribute/underline.rb +1 -1
- data/lib/term/ansicolor/attribute.rb +7 -6
- data/lib/term/ansicolor/version.rb +1 -1
- data/term-ansicolor.gemspec +3 -3
- data/tests/attribute_test.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: 3cbfd241e244b761869192a65bdf1ca6a11ca79910c8daa6633ce6a5aec73d5f
|
4
|
+
data.tar.gz: afe01235e057c5b6faa4b31a13369b8f86a00f9aca4bf07baf95a246ec7cf473
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2c8eaffdaa0e859738f01ab9276b70c2463fa5f647b5e2f5220b6c55c981eb5873a4255a404f17dfecf10479b4a6dfbd6a5bd7692ff1d2954a2d286658248c
|
7
|
+
data.tar.gz: 93733afa943c51b91c530897ce1cda156c927fd993a24defac4f647db9582ce0b8bb791bb272eb4b59f40afcc59af728dbf03ecb725a742013bca5ecb4696d3a
|
data/.all_images.yml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
dockerfile: |-
|
2
|
-
RUN apk add --no-cache build-base git
|
3
|
-
RUN
|
4
|
-
|
2
|
+
RUN apk add --no-cache build-base git bash
|
3
|
+
RUN bash <<NUR
|
4
|
+
if [[ "$(ruby -e 'print RUBY_VERSION')" > '3' ]]
|
5
|
+
then
|
6
|
+
gem update --system
|
7
|
+
gem install gem_hadar bundler
|
8
|
+
else
|
9
|
+
gem install gem_hadar
|
10
|
+
gem install bundler -v 2.4.22
|
11
|
+
fi
|
12
|
+
NUR
|
5
13
|
|
6
14
|
script: &script |-
|
7
15
|
echo -e "\e[1m"
|
@@ -15,3 +23,5 @@ images:
|
|
15
23
|
ruby:3.2-alpine: *script
|
16
24
|
ruby:3.1-alpine: *script
|
17
25
|
ruby:3.0-alpine: *script
|
26
|
+
ruby:2.7-alpine: *script
|
27
|
+
ruby:2.6-alpine: *script
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.10.
|
1
|
+
1.10.2
|
@@ -4,7 +4,7 @@ module Term
|
|
4
4
|
class Color256
|
5
5
|
Attribute.set :color0, 0, html: '#000000'
|
6
6
|
Attribute.set :color1, 1, html: '#800000'
|
7
|
-
Attribute.set :color2, 2, html: '#
|
7
|
+
Attribute.set :color2, 2, html: '#008000'
|
8
8
|
Attribute.set :color3, 3, html: '#808000'
|
9
9
|
Attribute.set :color4, 4, html: '#000080'
|
10
10
|
Attribute.set :color5, 5, html: '#800080'
|
@@ -2,23 +2,23 @@ module Term
|
|
2
2
|
module ANSIColor
|
3
3
|
class Attribute
|
4
4
|
class Color8
|
5
|
-
Attribute.set :black, 30,
|
6
|
-
Attribute.set :red, 31,
|
7
|
-
Attribute.set :green, 32,
|
8
|
-
Attribute.set :yellow, 33,
|
9
|
-
Attribute.set :blue, 34,
|
10
|
-
Attribute.set :magenta, 35,
|
11
|
-
Attribute.set :cyan, 36,
|
12
|
-
Attribute.set :white, 37,
|
5
|
+
Attribute.set :black, 30, direct: '#000000'
|
6
|
+
Attribute.set :red, 31, direct: '#800000'
|
7
|
+
Attribute.set :green, 32, direct: '#008000'
|
8
|
+
Attribute.set :yellow, 33, direct: '#808000'
|
9
|
+
Attribute.set :blue, 34, direct: '#000080'
|
10
|
+
Attribute.set :magenta, 35, direct: '#800080'
|
11
|
+
Attribute.set :cyan, 36, direct: '#008080'
|
12
|
+
Attribute.set :white, 37, direct: '#c0c0c0'
|
13
13
|
|
14
|
-
Attribute.set :on_black, 40,
|
15
|
-
Attribute.set :on_red, 41,
|
16
|
-
Attribute.set :on_green, 42,
|
17
|
-
Attribute.set :on_yellow, 43,
|
18
|
-
Attribute.set :on_blue, 44,
|
19
|
-
Attribute.set :on_magenta, 45,
|
20
|
-
Attribute.set :on_cyan, 46,
|
21
|
-
Attribute.set :on_white, 47,
|
14
|
+
Attribute.set :on_black, 40, direct: '#000000'
|
15
|
+
Attribute.set :on_red, 41, direct: '#800000'
|
16
|
+
Attribute.set :on_green, 42, direct: '#008000'
|
17
|
+
Attribute.set :on_yellow, 43, direct: '#808000'
|
18
|
+
Attribute.set :on_blue, 44, direct: '#000080'
|
19
|
+
Attribute.set :on_magenta, 45, direct: '#800080'
|
20
|
+
Attribute.set :on_cyan, 46, direct: '#008080'
|
21
|
+
Attribute.set :on_white, 47, direct: '#808080'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -2,41 +2,39 @@ module Term
|
|
2
2
|
module ANSIColor
|
3
3
|
class Attribute
|
4
4
|
class IntenseColor8
|
5
|
-
|
6
|
-
Attribute.set :
|
7
|
-
Attribute.set :
|
8
|
-
Attribute.set :
|
9
|
-
Attribute.set :
|
10
|
-
Attribute.set :
|
11
|
-
Attribute.set :
|
12
|
-
Attribute.set :
|
13
|
-
Attribute.set :
|
14
|
-
Attribute.set :
|
15
|
-
Attribute.set :
|
16
|
-
Attribute.set :
|
17
|
-
Attribute.set :
|
18
|
-
Attribute.set :
|
19
|
-
Attribute.set :
|
20
|
-
Attribute.set :
|
21
|
-
Attribute.set :bright_white, 97
|
5
|
+
Attribute.set :intense_black, 90, direct: '#808080'
|
6
|
+
Attribute.set :bright_black, 90, direct: '#808080'
|
7
|
+
Attribute.set :intense_red, 91, direct: '#ff0000'
|
8
|
+
Attribute.set :bright_red, 91, direct: '#ff0000'
|
9
|
+
Attribute.set :intense_green, 92, direct: '#00ff00'
|
10
|
+
Attribute.set :bright_green, 92, direct: '#00ff00'
|
11
|
+
Attribute.set :intense_yellow, 93, direct: '#ffff00'
|
12
|
+
Attribute.set :bright_yellow, 93, direct: '#ffff00'
|
13
|
+
Attribute.set :intense_blue, 94, direct: '#0000ff'
|
14
|
+
Attribute.set :bright_blue, 94, direct: '#0000ff'
|
15
|
+
Attribute.set :intense_magenta, 95, direct: '#ff00ff'
|
16
|
+
Attribute.set :bright_magenta, 95, direct: '#ff00ff'
|
17
|
+
Attribute.set :intense_cyan, 96, direct: '#00ffff'
|
18
|
+
Attribute.set :bright_cyan, 96, direct: '#00ffff'
|
19
|
+
Attribute.set :intense_white, 97, direct: '#ffffff'
|
20
|
+
Attribute.set :bright_white, 97, direct: '#ffffff'
|
22
21
|
|
23
|
-
|
24
|
-
Attribute.set :
|
25
|
-
Attribute.set :
|
26
|
-
Attribute.set :
|
27
|
-
Attribute.set :
|
28
|
-
Attribute.set :
|
29
|
-
Attribute.set :
|
30
|
-
Attribute.set :
|
31
|
-
Attribute.set :
|
32
|
-
Attribute.set :
|
33
|
-
Attribute.set :
|
34
|
-
Attribute.set :
|
35
|
-
Attribute.set :
|
36
|
-
Attribute.set :
|
37
|
-
Attribute.set :
|
38
|
-
Attribute.set :
|
39
|
-
Attribute.set :on_bright_white, 107
|
22
|
+
Attribute.set :on_intense_black, 100, direct: '#808080'
|
23
|
+
Attribute.set :on_bright_black, 100, direct: '#808080'
|
24
|
+
Attribute.set :on_intense_red, 101, direct: '#ff0000'
|
25
|
+
Attribute.set :on_bright_red, 101, direct: '#ff0000'
|
26
|
+
Attribute.set :on_intense_green, 102, direct: '#00ff00'
|
27
|
+
Attribute.set :on_bright_green, 102, direct: '#00ff00'
|
28
|
+
Attribute.set :on_intense_yellow, 103, direct: '#ffff00'
|
29
|
+
Attribute.set :on_bright_yellow, 103, direct: '#ffff00'
|
30
|
+
Attribute.set :on_intense_blue, 104, direct: '#0000ff'
|
31
|
+
Attribute.set :on_bright_blue, 104, direct: '#0000ff'
|
32
|
+
Attribute.set :on_intense_magenta, 105, direct: '#ff00ff'
|
33
|
+
Attribute.set :on_bright_magenta, 105, direct: '#ff00ff'
|
34
|
+
Attribute.set :on_intense_cyan, 106, direct: '#00ffff'
|
35
|
+
Attribute.set :on_bright_cyan, 106, direct: '#00ffff'
|
36
|
+
Attribute.set :on_intense_white, 107, direct: '#ffffff'
|
37
|
+
Attribute.set :on_bright_white, 107, direct: '#ffffff'
|
40
38
|
end
|
41
39
|
end
|
42
40
|
end
|
@@ -17,7 +17,7 @@ module Term
|
|
17
17
|
if color
|
18
18
|
a = Term::ANSIColor::Attribute[color]
|
19
19
|
color_code =
|
20
|
-
if a.true_color? || a.rgb_color? || a.
|
20
|
+
if a.true_color? || a.rgb_color? || a.direct?
|
21
21
|
color_code = "\e[58;2;#{a.rgb.to_a * ?;}"
|
22
22
|
else
|
23
23
|
raise ArgumentError, "invalid color #{a.name.inspect}"
|
@@ -87,12 +87,13 @@ module Term
|
|
87
87
|
@name = name.to_sym
|
88
88
|
@background = !!options[:background]
|
89
89
|
@code = code.to_s
|
90
|
+
@direct = false
|
90
91
|
@true_color = false
|
91
92
|
if rgb = options[:true_color]
|
92
93
|
@true_color = true
|
93
94
|
@rgb = rgb
|
94
|
-
elsif rgb = options[:
|
95
|
-
@
|
95
|
+
elsif rgb = options[:direct]
|
96
|
+
@direct = true
|
96
97
|
@rgb = RGBTriple.from_html(rgb)
|
97
98
|
elsif html = options[:html]
|
98
99
|
@rgb = RGBTriple.from_html(html)
|
@@ -110,7 +111,7 @@ module Term
|
|
110
111
|
background? ? "48;2;#{@rgb.to_a * ?;}" : "38;2;#{@rgb.to_a * ?;}"
|
111
112
|
elsif rgb_color?
|
112
113
|
background? ? "48;5;#{@code}" : "38;5;#{@code}"
|
113
|
-
elsif
|
114
|
+
elsif direct?
|
114
115
|
background? ? (@code.to_i + 10).to_s : @code
|
115
116
|
else
|
116
117
|
@code
|
@@ -125,8 +126,8 @@ module Term
|
|
125
126
|
!!@background
|
126
127
|
end
|
127
128
|
|
128
|
-
def
|
129
|
-
!!@
|
129
|
+
def direct?
|
130
|
+
!!@direct
|
130
131
|
end
|
131
132
|
|
132
133
|
attr_writer :background
|
@@ -134,7 +135,7 @@ module Term
|
|
134
135
|
attr_reader :rgb
|
135
136
|
|
136
137
|
def rgb_color?
|
137
|
-
!!@rgb && !@true_color && !@
|
138
|
+
!!@rgb && !@true_color && !@direct
|
138
139
|
end
|
139
140
|
|
140
141
|
def true_color?
|
data/term-ansicolor.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: term-ansicolor 1.10.
|
2
|
+
# stub: term-ansicolor 1.10.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "term-ansicolor".freeze
|
6
|
-
s.version = "1.10.
|
6
|
+
s.version = "1.10.2".freeze
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2024-06-
|
11
|
+
s.date = "2024-06-22"
|
12
12
|
s.description = "This library uses ANSI escape sequences to control the attributes of terminal output".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["term_cdiff".freeze, "term_colortab".freeze, "term_decolor".freeze, "term_display".freeze, "term_mandel".freeze, "term_snow".freeze]
|
data/tests/attribute_test.rb
CHANGED
@@ -98,7 +98,7 @@ class AttributeTest < Test::Unit::TestCase
|
|
98
98
|
)
|
99
99
|
assert_equal %w[
|
100
100
|
#00ffaf #1febaa #3ed7a5 #5dc3a0 #7caf9b #9b9b96 #ba8791 #d9738c #ff5f87
|
101
|
-
], g1.map {
|
101
|
+
], g1.map { |c| c.rgb.html }
|
102
102
|
g2 = Attribute['#30ffaa'].gradient_to(
|
103
103
|
Attribute['#ff507f'],
|
104
104
|
steps: 9,
|
@@ -107,6 +107,6 @@ class AttributeTest < Test::Unit::TestCase
|
|
107
107
|
)
|
108
108
|
assert_equal %w[
|
109
109
|
#00ffaf #1febaa #3ed7a5 #5dc3a0 #7caf9b #9b9b96 #ba8791 #d9738c #ff5f87
|
110
|
-
], g2.map {
|
110
|
+
], g2.map { |c| c.rgb.html }
|
111
111
|
end
|
112
112
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: term-ansicolor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|