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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05e177dc3351cb4df53995d41fb554fe423c1b03
4
- data.tar.gz: cdfbde91064c71a25488c4bb512025e000414e7e
3
+ metadata.gz: e57524547e4f0d8330baa3aae02ece0de8beafc6
4
+ data.tar.gz: 7a79f21033af42ebd1313ff8ba346b5851a00bdb
5
5
  SHA512:
6
- metadata.gz: c75ce5827937293b621ac725311c4866a75335526a735accdfd4be74dbd84c4b34582ba9da7254734d079797fc99cc079935cc12a36885daef5a62dae05f8200
7
- data.tar.gz: 66755452f8ccd918e4053fb9be004e9ca24f50e627838881b9e4c7df100cf677fbaaebf01972a51de5a44d4406843da760d6a3a653dfc912c25b00176572fed6
6
+ metadata.gz: 338eb89fd30c18a221f99c33065e80aae053fe1b5bd4f195237372ab4dceb9ef464ad832ee9247264f0775fff0fcb8b28cb1f43b60b6d3d65faf82794dc3810a
7
+ data.tar.gz: 6849172c81f4ae3af7f4d9ae1e7820fd43fb1747ed4fba257b079cff6a76847558f187f93677353d7999b11731a45af6511ee33f45b7bb522aa271a5c5d85b52
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- terminal (0.3.4)
4
+ terminal (0.3.5)
5
5
  escape_utils (~> 1.0)
6
6
  gemoji (~> 2.0)
7
7
 
@@ -12,6 +12,7 @@
12
12
  }
13
13
 
14
14
  .term-fg1 { } /* don't bold beccause it looks weird */
15
+ .term-fg3 { font-style: italic; } /* italic */
15
16
  .term-fg4 { text-decoration: underline; } /* underline */
16
17
  .term-fg9 { text-decoration: line-through; } /* crossed-out */
17
18
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Terminal
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -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[32mhi\e[39m there"
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-fg32'>hi</span> there")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Pitt