color_echo 0.3.0 → 0.4.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 +4 -4
- data/README.md +16 -1
- data/lib/color_echo/background.module.rb +1 -0
- data/lib/color_echo/foreground.module.rb +1 -0
- data/lib/color_echo/module_functions.rb +9 -1
- data/lib/color_echo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39af711706bd8e500fc5673edc8df5a5fb03d607
|
4
|
+
data.tar.gz: 15a50d0d65ebcedaf5d3ea50e20963278aacbddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d0c3bb3813a90203a0d99f1dbc4519ea9991ad15310d5496284602bdcb26c62b6c58bd6e08d01688bcaccef7adb66470924f4689c17a2a993d6208185d90ed3
|
7
|
+
data.tar.gz: a37cb37999324b77806bf25ef69781f8e8091355231d0534b1fa2ab3ec7edbacbbf63746aea89045782b636f8ef2b9e594d8addd3826d6ad1d613fd1248e91e8
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Using the ANSI escape sequence and give it a color on the command line output.
|
|
3
3
|
This Library will extend the Kernel module's functions(#print, #puts, #p).
|
4
4
|
Required StringIO.
|
5
5
|
|
6
|
-
Version: 0.
|
6
|
+
Version: 0.4.0
|
7
7
|
Compliant Rubys Version: 1.9.3, 2.0.0, 2.1.0 (for Linux)
|
8
8
|
License: MIT
|
9
9
|
Gems repository: http://rubygems.org/gems/color_echo
|
@@ -47,6 +47,9 @@ return self.
|
|
47
47
|
* h_cyan
|
48
48
|
* h_white
|
49
49
|
|
50
|
+
available in version 0.4.0 on and after.
|
51
|
+
* index[1-256]
|
52
|
+
|
50
53
|
ex.) CE.ch_fg :red #=> foreground color will be changed red
|
51
54
|
|
52
55
|
#### CE.ch_bg :symbol
|
@@ -76,6 +79,9 @@ return self.
|
|
76
79
|
* h_cyan
|
77
80
|
* h_white
|
78
81
|
|
82
|
+
available in version 0.4.0 on and after.
|
83
|
+
* index[1-256]
|
84
|
+
|
79
85
|
ex.) CE.ch_bg :white #=> background color will be changed white
|
80
86
|
|
81
87
|
|
@@ -126,6 +132,12 @@ Text color will change to rainbow color.
|
|
126
132
|
-> Can v0.2.4 on and after be able to specify a non-string when rainbow mode.
|
127
133
|
This method is available in version 0.2.0 on and after.
|
128
134
|
|
135
|
+
|
136
|
+
### Can to select 256 colors!
|
137
|
+
Please install color_echo and do `ruby test/check_color_index_list.rb`.
|
138
|
+

|
139
|
+
|
140
|
+
|
129
141
|
### Example
|
130
142
|
```ruby
|
131
143
|
#
|
@@ -212,6 +224,9 @@ puts "Disable rainbow mode."
|
|
212
224
|

|
213
225
|
|
214
226
|
## Release Note
|
227
|
+
* v0.4.0, 2014-12-11
|
228
|
+
* Can to select 256 colors.
|
229
|
+
|
215
230
|
* v0.3.0, 2014-12-08
|
216
231
|
* High color can now be selected.
|
217
232
|
* Multiple text attribute can now be selected.
|
@@ -158,7 +158,15 @@ module CE
|
|
158
158
|
# @return String
|
159
159
|
def convert_to_code(module_name, name)
|
160
160
|
begin
|
161
|
-
|
161
|
+
cname = name.to_s.swapcase
|
162
|
+
|
163
|
+
# specified color index
|
164
|
+
if cname.index("INDEX")
|
165
|
+
num = cname.sub("INDEX", "").to_i - 1
|
166
|
+
return eval(%{#{module_name}::INDEX}) + num.to_s + "m"
|
167
|
+
end
|
168
|
+
|
169
|
+
code = eval(%{#{module_name}::#{cname}})
|
162
170
|
rescue NameError
|
163
171
|
raise(NameError ,%{:#{name} is not defined! Please check reference.})
|
164
172
|
end
|
data/lib/color_echo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: color_echo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nyanko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Using the ANSI escape sequence and give it a color on the command line output.
|