colsole 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/colsole.rb +3 -3
- data/lib/colsole/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ed8305ec71b0b0263a635bf4424ddb8aeff919deea40ea6d18b2a11eb1eae01
|
4
|
+
data.tar.gz: 34bd4bd5b4288c9e204baa4aa2035f20bde43d5ccf11c9d741c6bbf6cf8b31c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 467cc227ae7fb5c074734918ebc24196a295ab077e4af69774795b64f194355ea77e862dbe010039d0f01a645007ac86a99d1d615ac19e23fa873b38d34eb011
|
7
|
+
data.tar.gz: d987f693eee608610451ab135e896556000a364d17c87164aaeebe5aee2335b25d9e41742e5ca4a28c96d37ec3d6e32f77c2c51673d5007c5283717663243a0f
|
data/lib/colsole.rb
CHANGED
@@ -23,10 +23,10 @@ module Colsole
|
|
23
23
|
# Space terminated strings will leave the cursor at the same line.
|
24
24
|
def say(text, force_color=false)
|
25
25
|
last = text[-1, 1]
|
26
|
-
if last == ' ' or last == '\t'
|
26
|
+
if terminal? and (last == ' ' or last == '\t')
|
27
27
|
print colorize(text, force_color)
|
28
28
|
else
|
29
|
-
print colorize("#{text}\n", force_color)
|
29
|
+
print colorize("#{text.rstrip}\n", force_color)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -39,7 +39,7 @@ module Colsole
|
|
39
39
|
# Erase the current output line, and say a new string.
|
40
40
|
# This should be used after a space terminated say().
|
41
41
|
def resay(text, force_color=false)
|
42
|
-
|
42
|
+
text = "\033[2K\r#{text}" if terminal?
|
43
43
|
say text, force_color
|
44
44
|
end
|
45
45
|
|
data/lib/colsole/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: colsole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Utility functions for making colorful console applications
|
14
14
|
email: db@dannyben.com
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
|
-
rubygems_version: 3.0.
|
41
|
+
rubygems_version: 3.0.3
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Colorful Console Applications
|