smooth_terminal_print 1.0.1 → 1.0.2
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 +5 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00940fb5da4ae2aae031aa8c435f3231d9152d0d
|
4
|
+
data.tar.gz: 342f9323895b6651672e7ce9eddb86a19add99de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db47cc5c1493eaf01ceefc4f59b5c207e7f984bb3936a761744454122b4f3ea330dec1e1338dc18ed4e56337bc0d588fcf3fa66d8f33a6522ede6be7e582809
|
7
|
+
data.tar.gz: 1ea6e5988cc0cb639c4d8da24b35133056e10f5a09593e1af8c65c5725e0431236db27c60c9d35e271310cb79a8c1ba26bfc9d750c0dc8c7f6ffdff68b5caffe
|
@@ -7,11 +7,11 @@ module SmoothTerminalPrint
|
|
7
7
|
|
8
8
|
def start(&block)
|
9
9
|
get_screen_dimensions
|
10
|
-
|
10
|
+
|
11
11
|
hide_cursor
|
12
|
-
|
12
|
+
|
13
13
|
move_to_top_left
|
14
|
-
|
14
|
+
|
15
15
|
io = StringIO.new
|
16
16
|
$stdout = io
|
17
17
|
yield
|
@@ -36,7 +36,6 @@ module SmoothTerminalPrint
|
|
36
36
|
line = ''
|
37
37
|
else
|
38
38
|
line.strip!
|
39
|
-
line = line[0..@columns]
|
40
39
|
end
|
41
40
|
|
42
41
|
line.length.upto(@columns) { line << ' ' }
|
@@ -47,7 +46,7 @@ module SmoothTerminalPrint
|
|
47
46
|
|
48
47
|
def get_screen_dimensions
|
49
48
|
@stp_reset_timer ||= nil
|
50
|
-
|
49
|
+
|
51
50
|
if(@stp_reset_timer == nil || Time.now.to_i - @stp_reset_timer > 3)
|
52
51
|
old_num_lines = @num_lines
|
53
52
|
old_num_cols = @columns
|
@@ -57,7 +56,7 @@ module SmoothTerminalPrint
|
|
57
56
|
if(old_num_lines != @num_lines || old_num_cols != @columns)
|
58
57
|
clear_screen
|
59
58
|
end
|
60
|
-
|
59
|
+
|
61
60
|
@stp_reset_timer = Time.now.to_i
|
62
61
|
end
|
63
62
|
end
|
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: 1.0.
|
4
|
+
version: 1.0.2
|
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-
|
11
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Allows the user to smoothly print to the terminal while in a tight loop
|
14
14
|
email: brettcsykes@gmail.com
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
40
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.
|
41
|
+
rubygems_version: 2.6.7
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Smoothly print to the terminal while in a tight loop
|