ppp_coloring 0.1.1 → 0.1.3

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
  SHA256:
3
- metadata.gz: c1859c91423ae7888cdb8ad1f41d1ef8cb85e9a2cc0e5d7d76e0857793d78e10
4
- data.tar.gz: '0041256069f0f6eb011bbd1091f1a999ed761e5d4c1c681e739336e86fb0be58'
3
+ metadata.gz: 987ca983f621c5f42cc9dc123e44aaf0dc0a79142a11251da6267cca20451ae4
4
+ data.tar.gz: 1871626847e2129bd6af4ab59367327e998f21ee79fde52e087e1717a989eac8
5
5
  SHA512:
6
- metadata.gz: 3f279809e564bfabb314f7eb13d4f5eeb9c84b30e2250cbd7b94ff4f0d827dafc18a543c90807d6c04c960978fac8f63f3a2bd05cb7a01e523e1e9ca9d63d054
7
- data.tar.gz: 64aedfe56f01586c6ce2ff01418d59a4540808f46e6f4f4cd2991c33220c3980e71b0735ad3b0709a6a93e99e6e9adc3d6f09374f8011fe7fecc50076481caa4
6
+ metadata.gz: 7b69938c18c72f816cc301248c72ec11f08a88717f6f2a26c64ee0bf589b49ee5fa85201804e64dde252a619b26e72347660d564e686b914dd2cd0ba7c5bd781
7
+ data.tar.gz: bc8ea66ce906ca1d4bce008e10c394269d5b3b9cd02bcf9342a828ae8d63179d702d0f4e883097bac1e77e1d514684980351965f582ad1644d325e8d4288b500
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PppColoring
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/ppp_coloring.rb CHANGED
@@ -3,23 +3,19 @@
3
3
  require_relative "ppp_coloring/version"
4
4
 
5
5
  module PppColoring
6
- class Error < StandardError; end
6
+ TYPES = {
7
+ 'info' => '36',
8
+ 'warn' => '35',
9
+ 'error' => '41',
10
+ 'success' => '42',
11
+ }.freeze
7
12
 
8
- class Coloring
9
- TYPES = {
10
- 'info' => '36',
11
- 'warn' => '35',
12
- 'error' => '41',
13
- 'success' => '42',
14
- }.freeze
15
-
16
- def ppp(arg, type = :info)
17
- puts coloring(arg, type.to_s)
18
- end
13
+ def self.ppp(arg, type = :info)
14
+ puts coloring(arg, type.to_s)
15
+ end
19
16
 
20
- def coloring(text, *a_types)
21
- types_codes = a_types.map { |s| TYPES.fetch(s, s) }
22
- "\e[#{types_codes.join(';')}m#{text}\e[0m"
23
- end
17
+ def self.coloring(text, *a_types)
18
+ types_codes = a_types.map { |s| TYPES.fetch(s, s) }
19
+ "\e[#{types_codes.join(';')}m#{text}\e[0m"
24
20
  end
25
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ppp_coloring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pnpk
@@ -9,7 +9,7 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 2025-01-13 00:00:00.000000000 Z
11
11
  dependencies: []
12
- description: コンソール出力時に文字列を色付けするためのライブラリ
12
+ description: Library for coloring strings in console output
13
13
  email: pnpk00@gmail.com
14
14
  executables: []
15
15
  extensions: []
@@ -47,5 +47,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  requirements: []
48
48
  rubygems_version: 3.6.2
49
49
  specification_version: 4
50
- summary: コンソール出力時に文字列を色付けするためのライブラリ
50
+ summary: Library for coloring strings in console output
51
51
  test_files: []