strmask 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +16 -4
- data/lib/strmask.rb +9 -8
- data/meta/released +1 -1
- data/meta/version +1 -1
- metadata +5 -5
data/HISTORY
CHANGED
@@ -1,10 +1,22 @@
|
|
1
1
|
= HISTORY
|
2
2
|
|
3
|
-
==
|
3
|
+
== 0.3.0 / 2010-04-18
|
4
4
|
|
5
|
-
This
|
5
|
+
This release changes #to_s and #inspect so they
|
6
|
+
re-insert the escape charater into the return string.
|
6
7
|
|
7
|
-
|
8
|
+
Changes:
|
8
9
|
|
9
|
-
|
10
|
+
* Changed #inspect to reinsert escape character.
|
11
|
+
* Changed #to_s to reinsert escape character.
|
12
|
+
|
13
|
+
|
14
|
+
== 0.2.1 / 2010-02-22
|
15
|
+
|
16
|
+
This is the initial public release of String::Mask.
|
17
|
+
This library was spun-off from Ruby Facets.
|
18
|
+
|
19
|
+
Changes:
|
20
|
+
|
21
|
+
* Happy Birthday!
|
10
22
|
|
data/lib/strmask.rb
CHANGED
@@ -21,6 +21,7 @@ class String
|
|
21
21
|
|
22
22
|
def initialize(string, re=nil)
|
23
23
|
@to_str = string.dup
|
24
|
+
@re = re
|
24
25
|
mask!(re) if re
|
25
26
|
end
|
26
27
|
|
@@ -40,14 +41,14 @@ class String
|
|
40
41
|
@to_str
|
41
42
|
end
|
42
43
|
|
43
|
-
#
|
44
|
+
# TODO: Should this use the escape character or not?
|
44
45
|
def to_s
|
45
|
-
to_str
|
46
|
+
@to_str.gsub(ESC, @re)
|
46
47
|
end
|
47
48
|
|
48
49
|
#
|
49
50
|
def inspect
|
50
|
-
to_str.inspect
|
51
|
+
@to_str.gsub(ESC, @re).inspect
|
51
52
|
end
|
52
53
|
|
53
54
|
#
|
@@ -84,7 +85,7 @@ class String
|
|
84
85
|
end
|
85
86
|
i += 1
|
86
87
|
end
|
87
|
-
self.class.new(o)
|
88
|
+
self.class.new(o, @re)
|
88
89
|
end
|
89
90
|
|
90
91
|
# Mask ADD. As long as there is a value other
|
@@ -108,7 +109,7 @@ class String
|
|
108
109
|
end
|
109
110
|
i += 1
|
110
111
|
end
|
111
|
-
self.class.new(o)
|
112
|
+
self.class.new(o, @re)
|
112
113
|
end
|
113
114
|
|
114
115
|
# Mask OR is the same as ADD.
|
@@ -135,7 +136,7 @@ class String
|
|
135
136
|
end
|
136
137
|
i += 1
|
137
138
|
end
|
138
|
-
self.class.new(o)
|
139
|
+
self.class.new(o, @re)
|
139
140
|
end
|
140
141
|
|
141
142
|
# Mask AND. Only where they are
|
@@ -158,7 +159,7 @@ class String
|
|
158
159
|
end
|
159
160
|
i += 1
|
160
161
|
end
|
161
|
-
self.class.new(o)
|
162
|
+
self.class.new(o, @re)
|
162
163
|
end
|
163
164
|
|
164
165
|
# Mask XOR operation. Only where there
|
@@ -183,7 +184,7 @@ class String
|
|
183
184
|
end
|
184
185
|
i += 1
|
185
186
|
end
|
186
|
-
self.class.new(o)
|
187
|
+
self.class.new(o, @re)
|
187
188
|
end
|
188
189
|
|
189
190
|
#
|
data/meta/released
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2010-
|
1
|
+
2010-04-18
|
data/meta/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Thomas Sawyer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-04-18 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
requirements: []
|
75
75
|
|
76
76
|
rubyforge_project: strmask
|
77
|
-
rubygems_version: 1.3.6
|
77
|
+
rubygems_version: 1.3.6
|
78
78
|
signing_key:
|
79
79
|
specification_version: 3
|
80
80
|
summary: String::Mask provides a kind-of string algebra
|