Skip to content

Commit 1905283

Browse files
fazibearfazibear
authored andcommitted
Use colorize dedicated method for color and modes
1 parent 4861fb8 commit 1905283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/sshkit/color.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'colorize'
22

33
module Color
4-
String::COLORS.each_pair do |color, _|
4+
String.colors.each do |color|
55
instance_eval <<-RUBY, __FILE__, __LINE__
66
def #{color}(string = '')
77
string = yield if block_given?
@@ -10,7 +10,7 @@ def #{color}(string = '')
1010
RUBY
1111
end
1212

13-
String::MODES.each_pair do |mode, _|
13+
String.modes.each do |mode|
1414
instance_eval <<-RUBY, __FILE__, __LINE__
1515
def #{mode}(string = '')
1616
string = yield if block_given?

0 commit comments

Comments
 (0)