verboss 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/verboss.rb +8 -7
  3. metadata +13 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3c450310e2fbcb5355c2b75965b3dd962bdeacb
4
- data.tar.gz: 6118b719dea1a7707b359bfdd2e424df09bd78aa
3
+ metadata.gz: 2a2f431eafa89e749d93f71058fa67a4f5efedbf
4
+ data.tar.gz: b3c9ff7708b64a1e1c031472e08eefae66fc6614
5
5
  SHA512:
6
- metadata.gz: dcb37d7378b8e81f240d21783b6d2e37a151a7a9552f3b692751b53c426951ca16667ce2fccb16e0e1e118e12f3368ba358ee182d73b6356c7783a32766f9f7f
7
- data.tar.gz: 5dd91533793897f0e57adc726073c2b215439948237fc988ba184bd2d8cabc13d9a9e4df250c81b603c9188099c9ec1cfa16b6f7b1b21c3a6844be27dcbcadeb
6
+ metadata.gz: a4752fed015d356cf8218503678016172cfe38285ba942d2fecfb8223f9057891747e7f0dd84658d6a501671345c2f2cb70f3bb9a947970803f63c3118fad647
7
+ data.tar.gz: 1d16f4838b521d0a08947549949e24bf0a977836689bc0e30475a80421c44c9bea921fb8ed22d83d6593ceea3ea4a2a008f43302a4edeaeccb632824d9f6f21f
data/lib/verboss.rb CHANGED
@@ -14,7 +14,7 @@
14
14
  #
15
15
  require 'format'
16
16
  module Verboss
17
- WIDTH = 64
17
+ WIDTH = `tput cols`.to_i rescue WIDTH = 64 # get number of terminal columns and stick with it # defaults to 64
18
18
  @@err_indent = "$ ".magenta
19
19
  @@out_indent = "| ".magenta
20
20
  @@root_stderr = $stderr
@@ -180,7 +180,7 @@ module Verboss
180
180
  # save a reference to the two IO's
181
181
  out = $stdout
182
182
  err = $stderr
183
- out.puts "/ #{description.to_s.fixed_width(WIDTH-4).bold} ".magenta + "\\"
183
+ out.puts "/ #{description.to_s.fixed_width(WIDTH-3).bold} ".magenta + "\\"
184
184
  begin # IO and Thread stuffs
185
185
  Verboss.start_spinner
186
186
  read_out, write_out = IO.pipe
@@ -191,7 +191,7 @@ module Verboss
191
191
  err_thread = Thread.new { err.print @@err_indent + read_err.gets("\n") until read_err.eof? }
192
192
  ret = yield
193
193
  rescue Exception => msg
194
- err.puts "# #{description.to_s.fixed_width(WIDTH-4)} FAIL ".bold.red
194
+ err.puts "# #{description.to_s.fixed_width(WIDTH-15)} FAIL ".bold.red
195
195
  raise msg
196
196
  ensure # whether or not the block fails close the pipes
197
197
  write_out.close
@@ -200,7 +200,8 @@ module Verboss
200
200
  err_thread.join
201
201
  Verboss.stop_spinner
202
202
  end
203
- out.puts "\\ #{"_ " * 14}".magenta + "DONE".green.bold + " in #{Time.now - start_time}s".fixed_width(14).cyan + " _ _ _ _ _ _ _ /".magenta
203
+
204
+ out.puts "\\ #{"_ " * (WIDTH - 22)/4}".magenta + "DONE".green.bold + " in #{Time.now - start_time}s".fixed_width(14).cyan + "#{" _" * (WIDTH - 22)/4} /".magenta
204
205
  return ret
205
206
  ensure # both IO's go back the way they were found
206
207
  $stderr = err
@@ -212,7 +213,7 @@ module Verboss
212
213
  # save a reference to the two IO's
213
214
  out = $stdout
214
215
  err = $stderr
215
- out.puts description.to_s.fixed_width(WIDTH-10).bold.magenta + " ... ".bold.blue if description
216
+ out.puts description.to_s.fixed_width(WIDTH-18).bold.magenta + ".... ".bold.blue if description
216
217
  begin # IO and Thread stuffs
217
218
  Verboss.start_spinner
218
219
  $stderr = StringIO.new
@@ -221,7 +222,7 @@ module Verboss
221
222
  rescue Exception => msg
222
223
  if description
223
224
  err.print "\e[1A"
224
- err.print "# #{description.to_s.fixed_width(WIDTH-6)}".red
225
+ err.print "# #{description.to_s.fixed_width(WIDTH-16)}".red
225
226
  end
226
227
  err.puts "FAIL".bold.red
227
228
  raise msg
@@ -230,7 +231,7 @@ module Verboss
230
231
  end
231
232
  if description
232
233
  out.print "\e[1A"
233
- out.puts description.to_s.fixed_width(WIDTH-8).bold.magenta + "DONE".green.bold + " in #{Time.now - start_time}s".fixed_width(14).cyan
234
+ out.puts description.to_s.fixed_width(WIDTH-18).bold.magenta + "DONE".green.bold + " in #{Time.now - start_time}s".fixed_width(14).cyan
234
235
  end
235
236
  return ret
236
237
  ensure # both IO's go back the way they were found
metadata CHANGED
@@ -1,45 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verboss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Behar
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-23 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: lightweight and simple terminal formatting
14
- email: lazymunky94@gmail.com
14
+ email: me@ben-behar.name
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
- - lib/verboss.rb
20
19
  - lib/format.rb
20
+ - lib/verboss.rb
21
21
  homepage: https://github.com/Ben-Behar/verboss
22
22
  licenses:
23
23
  - MIT
24
24
  metadata: {}
25
- post_install_message:
25
+ post_install_message:
26
26
  rdoc_options: []
27
27
  require_paths:
28
28
  - lib
29
29
  required_ruby_version: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  required_rubygems_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  requirements: []
40
- rubyforge_project:
41
- rubygems_version: 2.1.9
42
- signing_key:
40
+ rubyforge_project:
41
+ rubygems_version: 2.4.8
42
+ signing_key:
43
43
  specification_version: 4
44
- summary: verboss is a terminal formatting tool!
44
+ summary: verboss is a terminal output management solution
45
45
  test_files: []
46
+ has_rdoc: