super_p 0.0.1 → 0.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/super_p/version.rb +1 -1
- data/lib/super_p.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c98903457c360ca6b18d17f3d6f0bc6c59812020
|
4
|
+
data.tar.gz: e3e9f59f7b918903c031a5f1aedf36b61c0e08ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f8287a176a8dd8e114cfbdc8d91c1d38750d54192308df11bbb7f10edb0871f6e4851b8f01ad731bb558b63b5e82d72995fe65248347c0a70b09f5967873353
|
7
|
+
data.tar.gz: b25555dc66c1587ba46dce60b2e771cafcafb4e06e27efb0de617cecb2c65da4c548cd24d2204955cc3c40fed704dbda9e1d270b89cc02baa523a231d29cd7cf
|
data/lib/super_p/version.rb
CHANGED
data/lib/super_p.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "super_p/version"
|
2
|
+
require "g"
|
2
3
|
|
3
4
|
module SuperP
|
4
5
|
class <<self
|
@@ -12,7 +13,15 @@ module Kernel
|
|
12
13
|
cols = `tput cols`.to_i
|
13
14
|
print SuperP.color || "\e[45;35m"
|
14
15
|
puts " " * cols
|
15
|
-
puts *args.map
|
16
|
+
puts *args.map do |i|
|
17
|
+
text = i.inspect
|
18
|
+
padding = if text.size < cols
|
19
|
+
cols - text.size
|
20
|
+
else
|
21
|
+
text.size % cols
|
22
|
+
end
|
23
|
+
text + " " + padding
|
24
|
+
end
|
16
25
|
puts " " * cols
|
17
26
|
ensure
|
18
27
|
print "\e[0m"
|