hue-rb 1.0.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 +7 -0
- data/lib/hue.rb +56 -0
- metadata +43 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fa4319ea3d901f2b59a020a68c19605e5eff8b06449cab0c9b1631f230c9b0eb
|
|
4
|
+
data.tar.gz: ac567f99a45174ca59f209358852826996e0f336469171d881e1ed24ace15b9e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 0d23e0a000d2ea5747f77ed4050b5178db26a636f8ca263882cf8c954b5976030d85dc9ed3c530b9e4ac7fa9b9be88e81dc60c99d2e9b9a412e494c81e3766cf
|
|
7
|
+
data.tar.gz: 15194ad1f64902c6033f4f05ab4c9ec576cd92b986b654bee76cc553b8c230a435a5076e7a993b88979725fb443cd85a76810584572046ef6403dbe4c0e2ad19
|
data/lib/hue.rb
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
COLORS = {
|
|
2
|
+
# Colors
|
|
3
|
+
white: 97,
|
|
4
|
+
black: 30,
|
|
5
|
+
red: 31,
|
|
6
|
+
green: 32,
|
|
7
|
+
yellow: 33,
|
|
8
|
+
blue: 34,
|
|
9
|
+
magenta: 35,
|
|
10
|
+
cyan: 36,
|
|
11
|
+
light_gray: 37,
|
|
12
|
+
dark_dray: 38,
|
|
13
|
+
light_red: 91,
|
|
14
|
+
light_green: 92,
|
|
15
|
+
light_yellow: 93,
|
|
16
|
+
light_blue: 94,
|
|
17
|
+
light_magenta: 95,
|
|
18
|
+
light_cyan: 96,
|
|
19
|
+
|
|
20
|
+
# Styles
|
|
21
|
+
bold: 1,
|
|
22
|
+
italic: 3,
|
|
23
|
+
underlined: 4,
|
|
24
|
+
blink: 5,
|
|
25
|
+
inverted: 7,
|
|
26
|
+
hidden: 8,
|
|
27
|
+
strike: 9
|
|
28
|
+
}.freeze
|
|
29
|
+
|
|
30
|
+
LOGS = {
|
|
31
|
+
info: { color: :yellow, sym: '!' },
|
|
32
|
+
que: { color: :blue, sym: '?' },
|
|
33
|
+
bad: { color: :red, sym: '-' },
|
|
34
|
+
good: { color: :green, sym: '+' },
|
|
35
|
+
run: { color: :white, sym: '~' }
|
|
36
|
+
}.freeze
|
|
37
|
+
|
|
38
|
+
class String
|
|
39
|
+
COLORS.each do |name, value|
|
|
40
|
+
define_method name do
|
|
41
|
+
"\e[#{value}m#{self}"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
module Logs
|
|
47
|
+
LOGS.each do |name, values|
|
|
48
|
+
define_method name do |content|
|
|
49
|
+
puts "[#{values[:sym]}] ".send(values[:color]) + content.white
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class Object
|
|
55
|
+
include Logs
|
|
56
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: hue-rb
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- AnanaGame
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Hue adaptation to Ruby
|
|
14
|
+
email:
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/hue.rb
|
|
20
|
+
homepage: https://github.com/AnanaGame/hue-rb
|
|
21
|
+
licenses: []
|
|
22
|
+
metadata: {}
|
|
23
|
+
post_install_message:
|
|
24
|
+
rdoc_options: []
|
|
25
|
+
require_paths:
|
|
26
|
+
- lib
|
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0'
|
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '0'
|
|
37
|
+
requirements: []
|
|
38
|
+
rubyforge_project:
|
|
39
|
+
rubygems_version: 2.7.6
|
|
40
|
+
signing_key:
|
|
41
|
+
specification_version: 4
|
|
42
|
+
summary: Hue
|
|
43
|
+
test_files: []
|