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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smooth_terminal_print.rb +5 -6
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5ebf9a35ab3efc109bd2fa33457798b8b06d488
4
- data.tar.gz: 12bccbd3291b914f46ff1001940edc221d5d9e86
3
+ metadata.gz: 00940fb5da4ae2aae031aa8c435f3231d9152d0d
4
+ data.tar.gz: 342f9323895b6651672e7ce9eddb86a19add99de
5
5
  SHA512:
6
- metadata.gz: 4bc5590574bf1e85aeba89446487a16d235448dff3e393da9dae4bb56494c408cfa4fabdc585f2f49028f315592ea384eb413d545bfbd1620b283b96d6ea7a9a
7
- data.tar.gz: f09acd0d1b1d6df9492c85bd702933f4d8fd569fb74504fc603260598685d0021b4cbca10e76537ef617be54c73e605fe7ec77292e045f5b5e432b26f2c8af80
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.1
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-05-11 00:00:00.000000000 Z
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.4.5
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