colorb 0.0.6 → 0.0.6.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.
- data/lib/colorb.rb +3 -3
- metadata +3 -2
data/lib/colorb.rb
CHANGED
@@ -51,7 +51,7 @@ class String
|
|
51
51
|
def method_missing (id, *args, &block)
|
52
52
|
name = id.to_s.match(/^(.+?)[!?]?$/)[1].to_sym
|
53
53
|
|
54
|
-
result = (self.frozen? || !id.to_s.end_with?('!')) ? self.
|
54
|
+
result = (self.frozen? || !id.to_s.end_with?('!')) ? self.dup : self
|
55
55
|
|
56
56
|
return __old_method_missing(id, *args, &block) unless Colors[name] || Extra[name]
|
57
57
|
|
@@ -81,7 +81,7 @@ class String
|
|
81
81
|
def color (code, second=nil)
|
82
82
|
return method_missing(code.to_sym) if code.is_a?(Symbol) || code.is_a?(String)
|
83
83
|
|
84
|
-
self.
|
84
|
+
self.dup.color!(code, seond)
|
85
85
|
end
|
86
86
|
|
87
87
|
def color! (code, second=nil)
|
@@ -118,7 +118,7 @@ class String
|
|
118
118
|
def self.colorify (string, foreground, background, flags)
|
119
119
|
return string if ENV['NO_COLORS'] && !ENV['NO_COLORS'].empty?
|
120
120
|
|
121
|
-
result = string.
|
121
|
+
result = string.dup
|
122
122
|
|
123
123
|
result.sub!(/^/, [
|
124
124
|
String.color!(foreground),
|
metadata
CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.0.6.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- meh.
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-05 00:00:00 +01:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|