super_p 0.1.2 → 0.2.0
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.rb +7 -8
- data/lib/super_p/version.rb +1 -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: 8888d86a521ef76023a2e8ed2ece312755b0770b
|
4
|
+
data.tar.gz: d449b8926baefc404424ef35de0b319a405406ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf5731336022e3a73fb0c980a752c30d9ccdbfb31387c0c8fabe2bcaff1a885b49e70ac7fa1fafbae8442063030d164a0241523a10fdf4ff19c66fa74940a4bc
|
7
|
+
data.tar.gz: 6c7f3bd6491b6262f40badc26615f785842c2cddd80452dc27742aa019d09b17d2c75d0f4234d4d72fff8377de636a45c264c7e8b1b859163a93feb3d3da496c
|
data/lib/super_p.rb
CHANGED
@@ -1,26 +1,25 @@
|
|
1
1
|
require "super_p/version"
|
2
2
|
|
3
3
|
module SuperP
|
4
|
-
class <<self
|
5
|
-
|
6
|
-
end
|
4
|
+
class << self; attr_accessor :color; end
|
5
|
+
self.color = "\e[41;31;1m"
|
7
6
|
end
|
8
7
|
|
9
8
|
module Kernel
|
10
9
|
def super_p(*args)
|
11
10
|
cols = `tput cols`.to_i
|
12
11
|
puts
|
13
|
-
print SuperP.color
|
12
|
+
print SuperP.color
|
14
13
|
puts " " * cols
|
15
|
-
|
14
|
+
args.each do |i|
|
16
15
|
text = i.inspect
|
17
|
-
padding = if text.size
|
16
|
+
padding = if text.size <= cols
|
18
17
|
cols - text.size
|
19
18
|
else
|
20
19
|
cols - text.size % cols
|
21
20
|
end
|
22
|
-
text + " " * padding
|
23
|
-
end
|
21
|
+
puts text + " " * padding
|
22
|
+
end
|
24
23
|
puts " " * cols
|
25
24
|
print "\e[0m"
|
26
25
|
puts " " * cols
|
data/lib/super_p/version.rb
CHANGED