term-colorizer 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 +8 -8
- data/CHANGELOG.md +5 -1
- data/README.md +12 -0
- data/lib/term-colorizer/colorizer.rb +20 -22
- data/lib/term-colorizer/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2JiMWVhMjllYmIzYzM3NjdiMmQ1M2VhNTdlMjQ1OGQwYjY4ZDZiYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTZlYTYzMTcxZDZmOWM3MmIzY2RlOGZlNGUyNGY2ZDQyZWY3YjA5Mg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWQxYmIyYjBmYzBlZTQ1MDMwYzk2YjI5NGE3NDZjMDllZTY3MTU1MmE5NTY2
|
10
|
+
YmFiZTQ4ZDNiZTdiZWRjNjc2OWVkYjQxNzBlMGEzMDI1NmVmOWM1MjQzNTRk
|
11
|
+
YTY1ODkyOWNhMTNkOWJkM2IwNmIxOTIyYjU5MTQ1Y2I5YmViZjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWE5MmJhYmFkOTlmMTE1MjYxODY4Yzc2NTZiMWQzMTlhMDEzZDMyZDc4Mjlj
|
14
|
+
OGZlZDc2ZjY4N2FkZDhkOGY2OThiZDQ4ZDkyNTYwYzdiZDg3NmJiYjI4YWZh
|
15
|
+
YzAwM2RlYTI0Y2E2NDdkNWRkYmQ0MTdmY2UzMGJlZDY3NjEwYmI=
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
### 0.1.
|
1
|
+
### 0.1.2 (Next Release)
|
2
2
|
|
3
3
|
* Your contribution here.
|
4
4
|
|
5
|
+
### 0.1.1 (7/13/2013)
|
6
|
+
|
7
|
+
* Logic changed to dynamically define and call the color methods on strings - [@vishaltelangre](https://github.com/vishaltelangre).
|
8
|
+
|
5
9
|
### 0.1.0 (7/13/2013)
|
6
10
|
|
7
11
|
* Initial public release - [@vishaltelangre](https://github.com/vishaltelangre).
|
data/README.md
CHANGED
@@ -7,6 +7,18 @@ Print colorized strings on terminal (Useful for printing fancy logs)
|
|
7
7
|
|
8
8
|
## Usage
|
9
9
|
|
10
|
+
Install gem by using following command:
|
11
|
+
|
12
|
+
gem install term-colorizer
|
13
|
+
|
14
|
+
or add it to your Gemfile as:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem "term-colorizer"
|
18
|
+
```
|
19
|
+
|
20
|
+
and use it as:
|
21
|
+
|
10
22
|
``` ruby
|
11
23
|
"Duck can quack".green
|
12
24
|
# => "\e[32mDuck can quack\e[0m"
|
@@ -9,28 +9,26 @@ module Term
|
|
9
9
|
def method_missing(sym, *args, &block)
|
10
10
|
method = sym.to_s
|
11
11
|
super unless TERM_COLORS.include? method
|
12
|
-
self.send(method)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
when "bright_white" then define_method("bright_white") { "\e[1m\e[37m" + self.to_s + "\e[0m" }
|
33
|
-
end
|
12
|
+
self.class.send(:define_method, method) do
|
13
|
+
case method
|
14
|
+
when "black" then "\e[30m" + self.to_s + "\e[0m"
|
15
|
+
when "red" then "\e[31m" + self.to_s + "\e[0m"
|
16
|
+
when "green" then "\e[32m" + self.to_s + "\e[0m"
|
17
|
+
when "yellow" then "\e[33m" + self.to_s + "\e[0m"
|
18
|
+
when "blue" then "\e[34m" + self.to_s + "\e[0m"
|
19
|
+
when "magenta" then "\e[35m" + self.to_s + "\e[0m"
|
20
|
+
when "cyan" then "\e[36m" + self.to_s + "\e[0m"
|
21
|
+
when "white" then "\e[37m" + self.to_s + "\e[0m"
|
22
|
+
when "bright_black" then "\e[1m\e[30m" + self.to_s + "\e[0m"
|
23
|
+
when "bright_red" then "\e[1m\e[31m" + self.to_s + "\e[0m"
|
24
|
+
when "bright_green" then "\e[1m\e[32m" + self.to_s + "\e[0m"
|
25
|
+
when "bright_yellow" then "\e[1m\e[33m" + self.to_s + "\e[0m"
|
26
|
+
when "bright_blue" then "\e[1m\e[34m" + self.to_s + "\e[0m"
|
27
|
+
when "bright_magenta" then "\e[1m\e[35m" + self.to_s + "\e[0m"
|
28
|
+
when "bright_cyan" then "\e[1m\e[36m" + self.to_s + "\e[0m"
|
29
|
+
when "bright_white" then "\e[1m\e[37m" + self.to_s + "\e[0m"
|
30
|
+
end
|
31
|
+
end and self.send(method, *args)
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: term-colorizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vishal Telangre
|
@@ -56,4 +56,3 @@ signing_key:
|
|
56
56
|
specification_version: 4
|
57
57
|
summary: Print colorized strings on terminal (Useful for printing fancy logs)
|
58
58
|
test_files: []
|
59
|
-
has_rdoc:
|