ppp_coloring 0.1.0 → 0.1.1

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: 5f2e9f9cdc7347de7d84e9c7ca1caab40954a3494947a2042fe38530107e7dcf
4
- data.tar.gz: 5967eaf4f3f88f87b6360759db325a0cac04b2b12928fb82f26be8b51ab80802
3
+ metadata.gz: c1859c91423ae7888cdb8ad1f41d1ef8cb85e9a2cc0e5d7d76e0857793d78e10
4
+ data.tar.gz: '0041256069f0f6eb011bbd1091f1a999ed761e5d4c1c681e739336e86fb0be58'
5
5
  SHA512:
6
- metadata.gz: 5f0ca5c901493b6ccc1ddc6af2f59de230caed179e056ac02524e4bbd8775dcf7bd44bf6e6fc85f9abf938d1250af4c22a4a523d0172a37c7c3155f775761440
7
- data.tar.gz: 795165326c7a761b83486c5296ec1bdfc2814380e33c1a82d678955b54eeec329739b97c56c274cdc9de571aa5a9b1755bea31e3a1684ab893dc4f21cbfc1c87
6
+ metadata.gz: 3f279809e564bfabb314f7eb13d4f5eeb9c84b30e2250cbd7b94ff4f0d827dafc18a543c90807d6c04c960978fac8f63f3a2bd05cb7a01e523e1e9ca9d63d054
7
+ data.tar.gz: 64aedfe56f01586c6ce2ff01418d59a4540808f46e6f4f4cd2991c33220c3980e71b0735ad3b0709a6a93e99e6e9adc3d6f09374f8011fe7fecc50076481caa4
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PppColoring
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/ppp_coloring.rb CHANGED
@@ -4,5 +4,22 @@ require_relative "ppp_coloring/version"
4
4
 
5
5
  module PppColoring
6
6
  class Error < StandardError; end
7
- # Your code goes here...
7
+
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
19
+
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
24
+ end
8
25
  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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pnpk