term-ansicolor 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES +4 -0
- data/VERSION +1 -1
- data/lib/term/ansicolor.rb +17 -6
- data/lib/term/ansicolor/version.rb +1 -1
- data/term-ansicolor.gemspec +2 -2
- data/tests/ansicolor_test.rb +8 -0
- 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: ec07d4e73ee2229632950fb11a792a7ac58d46fe
|
4
|
+
data.tar.gz: b131e1eb5f84b05ec06341874f13b95ff3c14d9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615c2efc5fa34346c987a16dec877656dae1a19f6893dc60c4a63f8a62393d785dbb932c898d3eb203ed223c9525fcc64a191ece401ea77d96eba44413b7cd8f
|
7
|
+
data.tar.gz: c96ce5a595656b357047bad7dfbdcddc19f37debfb51857a23ef8debd9327ec3e127a4905b7f1c96fd5f5d4f65db61a65c58e4d59a8cc69e55f1557b0d218b50
|
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
2013-03-08 - 1.1.1 * Avoid possible conflicts with other people's attributes
|
2
|
+
methods.
|
3
|
+
* Cache attributes globally, also fix caching for frozen
|
4
|
+
strings.
|
1
5
|
2013-03-07 - 1.1.0 * Cleanup documentation.
|
2
6
|
* Implement color0 - color255 and on_color0 - on_color255
|
3
7
|
methods for xterm256 colors.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/lib/term/ansicolor.rb
CHANGED
@@ -123,7 +123,7 @@ module Term
|
|
123
123
|
|
124
124
|
module RespondTo
|
125
125
|
def respond_to?(symbol, include_all = false)
|
126
|
-
|
126
|
+
term_ansicolor_attributes.include?(symbol) or super
|
127
127
|
end
|
128
128
|
end
|
129
129
|
include RespondTo
|
@@ -149,12 +149,23 @@ module Term
|
|
149
149
|
|
150
150
|
alias uncolored uncolor
|
151
151
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
152
|
+
class << self
|
153
|
+
# Returns an array of all Term::ANSIColor attributes as symbols.
|
154
|
+
def term_ansicolor_attributes
|
155
|
+
@term_ansicolor_attributes ||= Term::ANSIColor::ATTRIBUTE_NAMES +
|
156
|
+
(0..255).map { |index| "color#{index}".to_sym } +
|
157
|
+
(0..255).map { |index| "on_color#{index}".to_sym }
|
158
|
+
end
|
159
|
+
|
160
|
+
alias attributes term_ansicolor_attributes
|
161
|
+
end
|
162
|
+
|
163
|
+
def term_ansicolor_attributes
|
164
|
+
::Term::ANSIColor.term_ansicolor_attributes
|
157
165
|
end
|
166
|
+
|
167
|
+
alias attributes term_ansicolor_attributes
|
168
|
+
|
158
169
|
extend self
|
159
170
|
end
|
160
171
|
end
|
data/term-ansicolor.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "term-ansicolor"
|
5
|
-
s.version = "1.1.
|
5
|
+
s.version = "1.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Florian Frank"]
|
9
|
-
s.date = "2013-03-
|
9
|
+
s.date = "2013-03-08"
|
10
10
|
s.description = ""
|
11
11
|
s.email = "flori@ping.de"
|
12
12
|
s.executables = ["cdiff", "decolor"]
|
data/tests/ansicolor_test.rb
CHANGED
@@ -91,4 +91,12 @@ class ANSIColorTest < Test::Unit::TestCase
|
|
91
91
|
def test_coloring_string_like
|
92
92
|
assert_equal "\e[31mred\e[0m", red(string_like)
|
93
93
|
end
|
94
|
+
|
95
|
+
def test_frozen
|
96
|
+
string = 'foo'
|
97
|
+
red = string.red
|
98
|
+
string.extend(Term::ANSIColor).freeze
|
99
|
+
assert string.frozen?
|
100
|
+
assert_equal red, string.red
|
101
|
+
end
|
94
102
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: term-ansicolor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|