terminal 0.3.3 → 0.3.4
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 +12 -0
- data/lib/terminal/version.rb +1 -1
- data/spec/terminal/renderer_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05e177dc3351cb4df53995d41fb554fe423c1b03
|
4
|
+
data.tar.gz: cdfbde91064c71a25488c4bb512025e000414e7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c75ce5827937293b621ac725311c4866a75335526a735accdfd4be74dbd84c4b34582ba9da7254734d079797fc99cc079935cc12a36885daef5a62dae05f8200
|
7
|
+
data.tar.gz: 66755452f8ccd918e4053fb9be004e9ca24f50e627838881b9e4c7df100cf677fbaaebf01972a51de5a44d4406843da760d6a3a653dfc912c25b00176572fed6
|
data/Gemfile.lock
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
|
14
14
|
.term-fg1 { } /* don't bold beccause it looks weird */
|
15
15
|
.term-fg4 { text-decoration: underline; } /* underline */
|
16
|
+
.term-fg9 { text-decoration: line-through; } /* crossed-out */
|
16
17
|
|
17
18
|
.term-fg30 { color: #666; } /* black (but we can't use black, so a diff color) */
|
18
19
|
.term-fg31 { color: #e10c02; } /* red */
|
data/lib/terminal/screen.rb
CHANGED
@@ -138,6 +138,18 @@ module Terminal
|
|
138
138
|
elsif c_integer == 10
|
139
139
|
# no-op
|
140
140
|
|
141
|
+
# Turn off bold
|
142
|
+
elsif c_integer == 21
|
143
|
+
@other_colors.delete("term-fg1")
|
144
|
+
|
145
|
+
# Turn off underline
|
146
|
+
elsif c_integer == 24
|
147
|
+
@other_colors.delete("term-fg4")
|
148
|
+
|
149
|
+
# Turn off crossed-out
|
150
|
+
elsif c_integer == 29
|
151
|
+
@other_colors.delete("term-fg9")
|
152
|
+
|
141
153
|
# Reset foreground color only
|
142
154
|
elsif c_integer == 39
|
143
155
|
@fg_color = nil
|
data/lib/terminal/version.rb
CHANGED
@@ -225,6 +225,24 @@ describe Terminal::Renderer do
|
|
225
225
|
|
226
226
|
expect(render(raw)).to eql("<span class='term-fg34 term-fg4 term-fg1'>good news</span>\n \neveryone")
|
227
227
|
end
|
228
|
+
|
229
|
+
it "ends underlining with \\e[24" do
|
230
|
+
raw = "\e[4mbegin\e[24m\r\nend"
|
231
|
+
|
232
|
+
expect(render(raw)).to eql("<span class='term-fg4'>begin</span>\nend")
|
233
|
+
end
|
234
|
+
|
235
|
+
it "ends bold with \\e[21" do
|
236
|
+
raw = "\e[1mbegin\e[21m\r\nend"
|
237
|
+
|
238
|
+
expect(render(raw)).to eql("<span class='term-fg1'>begin</span>\nend")
|
239
|
+
end
|
240
|
+
|
241
|
+
it "ends crossed out with \\e[29" do
|
242
|
+
raw = "\e[9mbegin\e[29m\r\nend"
|
243
|
+
|
244
|
+
expect(render(raw)).to eql("<span class='term-fg9'>begin</span>\nend")
|
245
|
+
end
|
228
246
|
end
|
229
247
|
|
230
248
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terminal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Pitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: escape_utils
|