super_p 0.1.2 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8dff1daee27bd339744c364299d5a0f6bafe3a8
4
- data.tar.gz: d767371561d6bc39969e23979de5853a191fb435
3
+ metadata.gz: 8888d86a521ef76023a2e8ed2ece312755b0770b
4
+ data.tar.gz: d449b8926baefc404424ef35de0b319a405406ab
5
5
  SHA512:
6
- metadata.gz: 67b09b2e0636d60202a5183b322a1bc979fea283c2ff7bc5dcb9c8d4a6278345279b4c775732152c31d788fb4248507b33765bc476475f66659b3c1ca069c37d
7
- data.tar.gz: d5118cb4d9acbed98815c7b361ce07c31ce2def4bb6915de3371118597ec17a508a4cadbaeadcd333e17f3198c873b97156f196e3a88bfaa6f4bc76750be8c17
6
+ metadata.gz: cf5731336022e3a73fb0c980a752c30d9ccdbfb31387c0c8fabe2bcaff1a885b49e70ac7fa1fafbae8442063030d164a0241523a10fdf4ff19c66fa74940a4bc
7
+ data.tar.gz: 6c7f3bd6491b6262f40badc26615f785842c2cddd80452dc27742aa019d09b17d2c75d0f4234d4d72fff8377de636a45c264c7e8b1b859163a93feb3d3da496c
@@ -1,26 +1,25 @@
1
1
  require "super_p/version"
2
2
 
3
3
  module SuperP
4
- class <<self
5
- attr_accessor :color
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 || "\e[45;35m"
12
+ print SuperP.color
14
13
  puts " " * cols
15
- puts *(args.map do |i|
14
+ args.each do |i|
16
15
  text = i.inspect
17
- padding = if text.size < cols
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
@@ -1,3 +1,3 @@
1
1
  module SuperP
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo