colorize 1.0.2 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/colorize/class_methods.rb +17 -17
- data/lib/colorize/instance_methods.rb +1 -1
- data/lib/colorize/version.rb +1 -1
- data/test/test_colorize.rb +1 -1
- 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: 96a8cb83d923d510e6c2eb252edf612ccf052e6e4f0a1c3e2a7acfd90323dc40
|
4
|
+
data.tar.gz: 9ed2a4cb4e82a83c726cd63173cda755c6dbff39329e28e33c0ffdedc304eaa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61c0f448e3cf1651cc707b5d0691e329743d8c1473458100ce466bc2f98f13c2a1bd511d91836606c7dcc4bd3321b068947fd965a3774c65bb38d1002ceed15e
|
7
|
+
data.tar.gz: bbc9cc5151b2b6e21f24300a5a08c45068e6cfa1018b2d6865665b9ce509db25823341b758c61002d2d1e8692fbda3d3fd4365ea1a72326b873a227495ba4741
|
data/CHANGELOG.md
CHANGED
@@ -3,23 +3,23 @@
|
|
3
3
|
module Colorize
|
4
4
|
module ClassMethods
|
5
5
|
@@color_codes ||= {
|
6
|
-
black:
|
7
|
-
red:
|
8
|
-
green:
|
9
|
-
yellow:
|
10
|
-
blue:
|
11
|
-
|
12
|
-
cyan:
|
13
|
-
white:
|
14
|
-
default:
|
15
|
-
light_black:
|
16
|
-
light_red:
|
17
|
-
light_green:
|
18
|
-
light_yellow:
|
19
|
-
light_blue:
|
20
|
-
|
21
|
-
light_cyan:
|
22
|
-
light_white:
|
6
|
+
black: 30,
|
7
|
+
red: 31,
|
8
|
+
green: 32,
|
9
|
+
yellow: 33,
|
10
|
+
blue: 34,
|
11
|
+
magenta: 35,
|
12
|
+
cyan: 36,
|
13
|
+
white: 37,
|
14
|
+
default: 39,
|
15
|
+
light_black: 90,
|
16
|
+
light_red: 91,
|
17
|
+
light_green: 92,
|
18
|
+
light_yellow: 93,
|
19
|
+
light_blue: 94,
|
20
|
+
light_magenta: 95,
|
21
|
+
light_cyan: 96,
|
22
|
+
light_white: 97
|
23
23
|
}
|
24
24
|
|
25
25
|
@@mode_codes ||= {
|
@@ -118,7 +118,7 @@ module Colorize
|
|
118
118
|
# Scan for colorized string
|
119
119
|
#
|
120
120
|
def scan_for_colors
|
121
|
-
scan(/\001?\033\[([0-9;]+)m\002?(.+?)\001?\033\[0m\002?|([^\001
|
121
|
+
scan(/\001?\033\[([0-9;]+)m\002?(.+?)\001?\033\[0m\002?|([^\001\033]+)/m).map do |match|
|
122
122
|
split_colors(match)
|
123
123
|
end
|
124
124
|
end
|
data/lib/colorize/version.rb
CHANGED
data/test/test_colorize.rb
CHANGED
@@ -21,7 +21,7 @@ class TestColorize < Minitest::Test
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_blue_hash
|
24
|
-
assert_equal "\001\033[0;34;49m\002This is also blue
|
24
|
+
assert_equal "\001\033[0;34;49m\002This is also blue?\001\033[0m\002", 'This is also blue?'.colorize(:color => :blue)
|
25
25
|
end
|
26
26
|
|
27
27
|
def test_light_blue_symbol
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colorize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Kalbarczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Extends String class or add a ColorizedString with methods to set text
|
14
14
|
color, background color and text effects.
|