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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b4b022358ec0c08c813fd02b38a04f434d49fcd75db660e25b8fe99a7b1e847
4
- data.tar.gz: a829c2406f9a20c5738297253bcf3e3dc46f497fbb0c3433bef01fa488cd9c10
3
+ metadata.gz: 3cbfd241e244b761869192a65bdf1ca6a11ca79910c8daa6633ce6a5aec73d5f
4
+ data.tar.gz: afe01235e057c5b6faa4b31a13369b8f86a00f9aca4bf07baf95a246ec7cf473
5
5
  SHA512:
6
- metadata.gz: 1ee33e17663543ec540ae88b5e84ff8ea6651394d62fe71086258f1294e556180c3255a3f2615dba39f54ab712927b5d862607995e41e7a86cbd43e3ffc89230
7
- data.tar.gz: b17b3b732562f3132f478d01c6ba8b96ae9c158d50ad0ca147c722ddc232125301d911574996e023a4e25696ef574bfce986df05b5a487bd43fb5d82fb6ba4ae
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 gem update --system
4
- RUN gem install gem_hadar bundler
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.0
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: '#808000'
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, color8: '#000000'
6
- Attribute.set :red, 31, color8: '#800000'
7
- Attribute.set :green, 32, color8: '#008000'
8
- Attribute.set :yellow, 33, color8: '#808000'
9
- Attribute.set :blue, 34, color8: '#000080'
10
- Attribute.set :magenta, 35, color8: '#800080'
11
- Attribute.set :cyan, 36, color8: '#008080'
12
- Attribute.set :white, 37, color8: '#c0c0c0'
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, color8: '#000000'
15
- Attribute.set :on_red, 41, color8: '#800000'
16
- Attribute.set :on_green, 42, color8: '#008000'
17
- Attribute.set :on_yellow, 43, color8: '#808000'
18
- Attribute.set :on_blue, 44, color8: '#000080'
19
- Attribute.set :on_magenta, 45, color8: '#800080'
20
- Attribute.set :on_cyan, 46, color8: '#008080'
21
- Attribute.set :on_white, 47, color8: '#808080'
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
- # High intensity, aixterm (works in OS X)
6
- Attribute.set :intense_black, 90
7
- Attribute.set :bright_black, 90
8
- Attribute.set :intense_red, 91
9
- Attribute.set :bright_red, 91
10
- Attribute.set :intense_green, 92
11
- Attribute.set :bright_green, 92
12
- Attribute.set :intense_yellow, 93
13
- Attribute.set :bright_yellow, 93
14
- Attribute.set :intense_blue, 94
15
- Attribute.set :bright_blue, 94
16
- Attribute.set :intense_magenta, 95
17
- Attribute.set :bright_magenta, 95
18
- Attribute.set :intense_cyan, 96
19
- Attribute.set :bright_cyan, 96
20
- Attribute.set :intense_white, 97
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
- # High intensity background, aixterm (works in OS X)
24
- Attribute.set :on_intense_black, 100
25
- Attribute.set :on_bright_black, 100
26
- Attribute.set :on_intense_red, 101
27
- Attribute.set :on_bright_red, 101
28
- Attribute.set :on_intense_green, 102
29
- Attribute.set :on_bright_green, 102
30
- Attribute.set :on_intense_yellow, 103
31
- Attribute.set :on_bright_yellow, 103
32
- Attribute.set :on_intense_blue, 104
33
- Attribute.set :on_bright_blue, 104
34
- Attribute.set :on_intense_magenta, 105
35
- Attribute.set :on_bright_magenta, 105
36
- Attribute.set :on_intense_cyan, 106
37
- Attribute.set :on_bright_cyan, 106
38
- Attribute.set :on_intense_white, 107
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.color8?
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[:color8]
95
- @color8 = true
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 color8?
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 color8?
129
- !!@color8
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 && !@color8
138
+ !!@rgb && !@true_color && !@direct
138
139
  end
139
140
 
140
141
  def true_color?
@@ -1,6 +1,6 @@
1
1
  module Term::ANSIColor
2
2
  # Term::ANSIColor version
3
- VERSION = '1.10.0'
3
+ VERSION = '1.10.2'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: term-ansicolor 1.10.0 ruby lib
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.0".freeze
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-21"
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]
@@ -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 { _1.rgb.html }
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 { _1.rgb.html }
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.0
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-21 00:00:00.000000000 Z
11
+ date: 2024-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar