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.
- checksums.yaml +4 -4
- data/lib/verboss.rb +8 -7
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2f431eafa89e749d93f71058fa67a4f5efedbf
|
4
|
+
data.tar.gz: b3c9ff7708b64a1e1c031472e08eefae66fc6614
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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-
|
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
|
-
|
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-
|
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-
|
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-
|
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.
|
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:
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: lightweight and simple terminal formatting
|
14
|
-
email:
|
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.
|
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
|
44
|
+
summary: verboss is a terminal output management solution
|
45
45
|
test_files: []
|
46
|
+
has_rdoc:
|