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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 116e3a62450d704932ed8d3df5a46923ad695826
4
- data.tar.gz: 7429181fe97fdfc47fbc05449f33a9d212114a00
3
+ metadata.gz: c98903457c360ca6b18d17f3d6f0bc6c59812020
4
+ data.tar.gz: e3e9f59f7b918903c031a5f1aedf36b61c0e08ce
5
5
  SHA512:
6
- metadata.gz: 6ca4050bc09d9ff6d182a056c63353e1f63bcdade200faac4cdbce4ec193c642356650d90379d04964be7645c185a87ee9c28f642359ed060dba6a9b58db139d
7
- data.tar.gz: c40895130aef8b1e2c6b9e3ce3e3d135daa150428913e9cf67d0e45717f1456a17843f196e1a77876c584d5108d1b1f7d0414020bb796f4712bdcad21c9c00c9
6
+ metadata.gz: 2f8287a176a8dd8e114cfbdc8d91c1d38750d54192308df11bbb7f10edb0871f6e4851b8f01ad731bb558b63b5e82d72995fe65248347c0a70b09f5967873353
7
+ data.tar.gz: b25555dc66c1587ba46dce60b2e771cafcafb4e06e27efb0de617cecb2c65da4c548cd24d2204955cc3c40fed704dbda9e1d270b89cc02baa523a231d29cd7cf
@@ -1,3 +1,3 @@
1
1
  module SuperP
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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 { |i| "#{i.inspect}#{' ' * (i.inspect.size % cols)}" }
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_p
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo