coloring 0.1.1 → 0.1.2
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.
- data/.rspec +2 -0
- data/Rakefile +0 -4
- data/coloring.gemspec +1 -1
- data/lib/coloring.rb +7 -15
- data/lib/coloring/version.rb +1 -1
- data/spec/coloring_spec.rb +3 -6
- metadata +5 -4
- data/CHANGELOG.md +0 -22
data/.rspec
ADDED
data/Rakefile
CHANGED
data/coloring.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ require File.expand_path('../lib/coloring/version', __FILE__)
|
|
|
4
4
|
Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ["DoZator"]
|
|
6
6
|
gem.email = ["oabogatenko@gmail.com"]
|
|
7
|
-
gem.description = %q{Adds methods for coloring and styling text for class String}
|
|
7
|
+
gem.description = %q{Adds methods for coloring and styling text for class String. Supports 256 colors.}
|
|
8
8
|
gem.summary = %q{Terminal text painter}
|
|
9
9
|
gem.homepage = ""
|
|
10
10
|
|
data/lib/coloring.rb
CHANGED
|
@@ -91,29 +91,22 @@ module Coloring
|
|
|
91
91
|
|
|
92
92
|
def gamma
|
|
93
93
|
|
|
94
|
-
puts "All base methods
|
|
94
|
+
puts "\n# All base methods:\n".yellow
|
|
95
95
|
|
|
96
96
|
SGRPARAMS.each { |key,value| puts "#{key}".coloring(value) + " method: #{key}" }
|
|
97
97
|
|
|
98
|
-
puts "\n"
|
|
99
|
-
puts "System colors for xterm-256color:".on_yellow + "\n\n"
|
|
98
|
+
puts "\n# System colors for xterm-256color:\n".yellow
|
|
100
99
|
|
|
101
|
-
0.upto(
|
|
100
|
+
0.upto(15) do |i|
|
|
102
101
|
print "\033[48;5;#{i}m #{i} \033[000m"
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
puts "\n"
|
|
106
|
-
|
|
107
|
-
8.upto(15) do |i|
|
|
108
|
-
print "\033[48;5;#{i}m #{i} \033[000m"
|
|
109
|
-
end
|
|
102
|
+
end
|
|
110
103
|
|
|
111
104
|
puts "\n\n"
|
|
112
105
|
|
|
113
106
|
0.upto(5) do |g|
|
|
114
107
|
0.upto(5) do |r|
|
|
115
108
|
0.upto(5) do |b|
|
|
116
|
-
color = 16 + r*36 + g
|
|
109
|
+
color = 16 + r*36 + g + b*6
|
|
117
110
|
print "\033[48;5;#{color}m #{color}"
|
|
118
111
|
end
|
|
119
112
|
print "\033[0m "
|
|
@@ -121,14 +114,13 @@ module Coloring
|
|
|
121
114
|
print "\n"
|
|
122
115
|
end
|
|
123
116
|
|
|
124
|
-
puts "\n"
|
|
125
|
-
puts "Grayscale ramp:".on_yellow + "\n\n"
|
|
117
|
+
puts "\n# Grayscale ramp:\n".yellow
|
|
126
118
|
|
|
127
119
|
232.upto(255) do |i|
|
|
128
120
|
print "\033[48;5;#{i}m #{i} \033[000m"
|
|
129
121
|
end
|
|
130
122
|
|
|
131
|
-
puts "\n"
|
|
123
|
+
puts "\n\n"
|
|
132
124
|
end
|
|
133
125
|
|
|
134
126
|
end
|
data/lib/coloring/version.rb
CHANGED
data/spec/coloring_spec.rb
CHANGED
|
@@ -8,9 +8,7 @@ describe Coloring do
|
|
|
8
8
|
|
|
9
9
|
describe "all base methods" do
|
|
10
10
|
|
|
11
|
-
it
|
|
12
|
-
@sample.red.class.should == String
|
|
13
|
-
end
|
|
11
|
+
it { @sample.red.should be_an_instance_of(String) }
|
|
14
12
|
|
|
15
13
|
it "should return right content" do
|
|
16
14
|
@sample.red.should eq("\e[31mHello, World!\e[0m")
|
|
@@ -32,9 +30,8 @@ describe Coloring do
|
|
|
32
30
|
expect { @sample.coloring(:red, :on_blue) }.to raise_error
|
|
33
31
|
end
|
|
34
32
|
|
|
35
|
-
it
|
|
36
|
-
|
|
37
|
-
end
|
|
33
|
+
it { @sample.coloring(:green).should be_an_instance_of(String) }
|
|
34
|
+
|
|
38
35
|
|
|
39
36
|
it "should return right content (input params: Symbol)" do
|
|
40
37
|
@sample.coloring(:green).should eq("\e[32mHello, World!\e[0m")
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coloring
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2012-10-
|
|
12
|
+
date: 2012-10-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rspec
|
|
@@ -27,7 +27,8 @@ dependencies:
|
|
|
27
27
|
- - ! '>='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
29
|
version: '0'
|
|
30
|
-
description: Adds methods for coloring and styling text for class String
|
|
30
|
+
description: Adds methods for coloring and styling text for class String. Supports
|
|
31
|
+
256 colors.
|
|
31
32
|
email:
|
|
32
33
|
- oabogatenko@gmail.com
|
|
33
34
|
executables:
|
|
@@ -36,7 +37,7 @@ extensions: []
|
|
|
36
37
|
extra_rdoc_files: []
|
|
37
38
|
files:
|
|
38
39
|
- .gitignore
|
|
39
|
-
-
|
|
40
|
+
- .rspec
|
|
40
41
|
- Gemfile
|
|
41
42
|
- LICENSE
|
|
42
43
|
- README.md
|
data/CHANGELOG.md
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#### 0.1.0 (2012-08-31)
|
|
2
|
-
|
|
3
|
-
* Added 256 colors suport
|
|
4
|
-
* Input params now can be Hash
|
|
5
|
-
* Added CLI to show all avaliable colors
|
|
6
|
-
* Added tests
|
|
7
|
-
|
|
8
|
-
#### 0.0.5 (2012-08-24)
|
|
9
|
-
|
|
10
|
-
* Added class method view_avaliable
|
|
11
|
-
* Method set_param now protected
|
|
12
|
-
* Added some tests
|
|
13
|
-
|
|
14
|
-
#### 0.0.4 (2012-08-22)
|
|
15
|
-
|
|
16
|
-
* Added specs
|
|
17
|
-
* Added full README
|
|
18
|
-
* Added this CHANGELOG file
|
|
19
|
-
|
|
20
|
-
#### 0.0.3 (2012-08-22)
|
|
21
|
-
|
|
22
|
-
* Start release
|