smooth_terminal_print 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smooth_terminal_print.rb +11 -2
- 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: 7834a40c9f642f5aa6845c9abb1dadb57e157769
|
4
|
+
data.tar.gz: 1958febfbff85b9a6652a2db96c06993fa77fa91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 557801c8090aa1580e4f8efb33c5013fc8d904a3672062fe6e801a6054396df32a19fba3904113afeca61ee71bb451a544baaa8e09378fae9751da4972a48f00
|
7
|
+
data.tar.gz: 9cfea9d5de40cc0fc2b6709811b8e82b1b70d5b2d6620cd32a76b067009d53255e51aaa26ebdeca7550f0f73228e3370c2389ad40f5870956b1c51672ffa295b
|
@@ -12,11 +12,20 @@ class SmoothTerminalPrint
|
|
12
12
|
at_exit { stop_smooth_printing_mode }
|
13
13
|
end
|
14
14
|
|
15
|
-
def print_smoothly(io)
|
15
|
+
def print_smoothly(io=nil, &block)
|
16
16
|
print(hide_cursor)
|
17
17
|
print(move_to_top_left)
|
18
18
|
|
19
|
-
|
19
|
+
if(io)
|
20
|
+
print_text(io)
|
21
|
+
else
|
22
|
+
io = StringIO.new
|
23
|
+
$stdout = io
|
24
|
+
yield
|
25
|
+
$stdout = STDOUT
|
26
|
+
io.rewind
|
27
|
+
print_text(io)
|
28
|
+
end
|
20
29
|
end
|
21
30
|
|
22
31
|
def stop_smooth_printing_mode
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smooth_terminal_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Sykes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Animate printing text in a terminal window while in a tight loop
|
14
14
|
email: brettcsykes@gmail.com
|