super_p 0.1.1 → 0.1.2

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: 45803ca28751a4f09054cf15de89269494e7feb1
4
- data.tar.gz: d785f5bd371476117f85d4ebdbcf9b90ad968a28
3
+ metadata.gz: b8dff1daee27bd339744c364299d5a0f6bafe3a8
4
+ data.tar.gz: d767371561d6bc39969e23979de5853a191fb435
5
5
  SHA512:
6
- metadata.gz: d3a2f4b48ca48cd4a73c5170f97e235a0e159e28f733072c1c7a4dc4a47b8703d5b2fc4e77a3b9128aa0d4f043b0b0cffaae21af26ba2cd85347188681a19d33
7
- data.tar.gz: 5faeb807b70bf398fd8acddcafac540ff572fc35d65bd8948c9d9c3abd57c4e93d99fad7c624e0abf362c79c7864f4975459930511c819ae9ee93ec962b2cd97
6
+ metadata.gz: 67b09b2e0636d60202a5183b322a1bc979fea283c2ff7bc5dcb9c8d4a6278345279b4c775732152c31d788fb4248507b33765bc476475f66659b3c1ca069c37d
7
+ data.tar.gz: d5118cb4d9acbed98815c7b361ce07c31ce2def4bb6915de3371118597ec17a508a4cadbaeadcd333e17f3198c873b97156f196e3a88bfaa6f4bc76750be8c17
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # SuperP
1
+ # super_p
2
2
 
3
3
  The super p.
4
4
 
data/lib/super_p.rb CHANGED
@@ -8,24 +8,26 @@ end
8
8
 
9
9
  module Kernel
10
10
  def super_p(*args)
11
- begin
12
- cols = `tput cols`.to_i
13
- print SuperP.color || "\e[45;35m"
14
- puts " " * cols
15
- puts *(args.map do |i|
16
- text = i.inspect
17
- padding = if text.size < cols
18
- cols - text.size
19
- else
20
- text.size % cols
21
- end
22
- text + " " * padding
23
- end)
24
- puts " " * cols
25
- ensure
26
- print "\e[0m"
27
- end
11
+ cols = `tput cols`.to_i
12
+ puts
13
+ print SuperP.color || "\e[45;35m"
14
+ puts " " * cols
15
+ puts *(args.map do |i|
16
+ text = i.inspect
17
+ padding = if text.size < cols
18
+ cols - text.size
19
+ else
20
+ cols - text.size % cols
21
+ end
22
+ text + " " * padding
23
+ end)
24
+ puts " " * cols
25
+ print "\e[0m"
26
+ puts " " * cols
27
+
28
28
  args.size == 1 ? args[0] : args
29
+ rescue
30
+ print "\e[0m"
29
31
  end
30
32
 
31
33
  alias_method :sp, :super_p
@@ -1,3 +1,3 @@
1
1
  module SuperP
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo