riel 1.1.13 → 1.1.14
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.
- data/lib/riel/text/ansi/ansi_highlight.rb +5 -0
- data/lib/riel.rb +1 -1
- data/test/riel/text/ansi/ansi_highlight_test.rb +18 -0
- metadata +4 -4
data/lib/riel.rb
CHANGED
@@ -122,4 +122,22 @@ class AnsiHighlightTestCase < Test::Unit::TestCase
|
|
122
122
|
# puts str
|
123
123
|
assert_equal "\x1b[48;5;54mABC\e[0m", str
|
124
124
|
end
|
125
|
+
|
126
|
+
def test_to_codes_one_color
|
127
|
+
hl = Text::ANSIHighlighter.instance
|
128
|
+
code = hl.to_codes 'blue'
|
129
|
+
assert_equal "\e[34m", code
|
130
|
+
end
|
131
|
+
|
132
|
+
def test_to_codes_decoration_color
|
133
|
+
hl = Text::ANSIHighlighter.instance
|
134
|
+
code = hl.to_codes 'bold blue'
|
135
|
+
assert_equal "\e[1m\e[34m", code
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_to_codes_background_color
|
139
|
+
hl = Text::ANSIHighlighter.instance
|
140
|
+
code = hl.to_codes 'on_blue'
|
141
|
+
assert_equal "\e[44m", code
|
142
|
+
end
|
125
143
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 14
|
10
|
+
version: 1.1.14
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeff Pace
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-12-
|
18
|
+
date: 2012-12-09 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|