smooth_terminal_print 1.0.2 → 1.0.4

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 +7 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00940fb5da4ae2aae031aa8c435f3231d9152d0d
4
- data.tar.gz: 342f9323895b6651672e7ce9eddb86a19add99de
3
+ metadata.gz: f2e82af0c5fb3899d0759e9f8bc470fd674711e0
4
+ data.tar.gz: 7224d9ff1e2bdcbac5d84df4298c29b8cf2edad1
5
5
  SHA512:
6
- metadata.gz: 3db47cc5c1493eaf01ceefc4f59b5c207e7f984bb3936a761744454122b4f3ea330dec1e1338dc18ed4e56337bc0d588fcf3fa66d8f33a6522ede6be7e582809
7
- data.tar.gz: 1ea6e5988cc0cb639c4d8da24b35133056e10f5a09593e1af8c65c5725e0431236db27c60c9d35e271310cb79a8c1ba26bfc9d750c0dc8c7f6ffdff68b5caffe
6
+ metadata.gz: f1ce7cba79bfe5283942869efc82afc878c73c3b33657fc37557edf55ddfa4ee01d3545a29684ad9e7e0688beef6d9e6289c0dd7bec84c811a7817c557acde2f
7
+ data.tar.gz: 7fd21a9dc81afa4438c0dc6f73dd882ff9052ab75c1f40cc2457cdf863d69465be24f675b6dd01f32974fa23c4bbaa03a23c78460a19ddd658db280be347a467
@@ -36,6 +36,13 @@ module SmoothTerminalPrint
36
36
  line = ''
37
37
  else
38
38
  line.strip!
39
+ # If the line includes ANSI escape codes then I'm not sure currently how to
40
+ # truncate them without creating a mess. So just skip them for now and suffer
41
+ # the consequences, being that, the screen will not refresh properly if there are ANSI
42
+ # escape codes in the string, AND the length of said string exceeds the total columns available.
43
+ if(!line.include?("\e["))
44
+ line = line[0..@columns]
45
+ end
39
46
  end
40
47
 
41
48
  line.length.upto(@columns) { line << ' ' }
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.2
4
+ version: 1.0.4
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-10-13 00:00:00.000000000 Z
11
+ date: 2016-10-14 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