terminal 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/stylesheets/terminal.css +1 -0
- data/lib/terminal/screen.rb +7 -2
- data/lib/terminal/version.rb +1 -1
- data/spec/terminal/renderer_spec.rb +20 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e57524547e4f0d8330baa3aae02ece0de8beafc6
|
4
|
+
data.tar.gz: 7a79f21033af42ebd1313ff8ba346b5851a00bdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 338eb89fd30c18a221f99c33065e80aae053fe1b5bd4f195237372ab4dceb9ef464ad832ee9247264f0775fff0fcb8b28cb1f43b60b6d3d65faf82794dc3810a
|
7
|
+
data.tar.gz: 6849172c81f4ae3af7f4d9ae1e7820fd43fb1747ed4fba257b079cff6a76847558f187f93677353d7999b11731a45af6511ee33f45b7bb522aa271a5c5d85b52
|
data/Gemfile.lock
CHANGED
data/lib/terminal/screen.rb
CHANGED
@@ -138,9 +138,14 @@ module Terminal
|
|
138
138
|
elsif c_integer == 10
|
139
139
|
# no-op
|
140
140
|
|
141
|
-
# Turn off bold
|
142
|
-
elsif c_integer == 21
|
141
|
+
# Turn off bold / Normal color or intensity (21 & 22 essentially do the same thing)
|
142
|
+
elsif c_integer == 21 || c_integer == 22
|
143
143
|
@other_colors.delete("term-fg1")
|
144
|
+
@other_colors.delete("term-fg2")
|
145
|
+
|
146
|
+
# Turn off italic
|
147
|
+
elsif c_integer == 23
|
148
|
+
@other_colors.delete("term-fg3")
|
144
149
|
|
145
150
|
# Turn off underline
|
146
151
|
elsif c_integer == 24
|
data/lib/terminal/version.rb
CHANGED
@@ -39,9 +39,9 @@ describe Terminal::Renderer do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "treats \\e[39m a reset" do
|
42
|
-
raw = "\e[
|
42
|
+
raw = "\e[36mthis has a color\e[39mthis is normal now\r\n"
|
43
43
|
|
44
|
-
expect(render(raw)).to eql("<span class='term-
|
44
|
+
expect(render(raw)).to eql("<span class='term-fg36'>this has a color</span>this is normal now")
|
45
45
|
end
|
46
46
|
|
47
47
|
it "starts overwriting characters when you \\r midway through somehing" do
|
@@ -238,11 +238,29 @@ describe Terminal::Renderer do
|
|
238
238
|
expect(render(raw)).to eql("<span class='term-fg1'>begin</span>\nend")
|
239
239
|
end
|
240
240
|
|
241
|
+
it "ends bold with \\e[22" do
|
242
|
+
raw = "\e[1mbegin\e[22m\r\nend"
|
243
|
+
|
244
|
+
expect(render(raw)).to eql("<span class='term-fg1'>begin</span>\nend")
|
245
|
+
end
|
246
|
+
|
241
247
|
it "ends crossed out with \\e[29" do
|
242
248
|
raw = "\e[9mbegin\e[29m\r\nend"
|
243
249
|
|
244
250
|
expect(render(raw)).to eql("<span class='term-fg9'>begin</span>\nend")
|
245
251
|
end
|
252
|
+
|
253
|
+
it "ends italic out with \\e[23" do
|
254
|
+
raw = "\e[3mbegin\e[23m\r\nend"
|
255
|
+
|
256
|
+
expect(render(raw)).to eql("<span class='term-fg3'>begin</span>\nend")
|
257
|
+
end
|
258
|
+
|
259
|
+
it "ends decreased intensity with \\e[22" do
|
260
|
+
raw = "\e[2mbegin\e[22m\r\nend"
|
261
|
+
|
262
|
+
expect(render(raw)).to eql("<span class='term-fg2'>begin</span>\nend")
|
263
|
+
end
|
246
264
|
end
|
247
265
|
|
248
266
|
private
|