dynarex 1.0.7 → 1.0.8
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/dynarex.rb +2 -4
- metadata +1 -1
data/lib/dynarex.rb
CHANGED
@@ -150,7 +150,7 @@ EOF
|
|
150
150
|
# 'a' and 'a_split' just used for validation
|
151
151
|
a = @format_mask.scan(/\[!\w+\]/)
|
152
152
|
a_split = @format_mask.split(/\[!\w+\]/)
|
153
|
-
|
153
|
+
|
154
154
|
if a.length == 2 and a_split[1].length == 1 then
|
155
155
|
a2 = []
|
156
156
|
|
@@ -161,12 +161,10 @@ EOF
|
|
161
161
|
a2 << "(.*)"
|
162
162
|
t = a2.join
|
163
163
|
else
|
164
|
+
# convert the format mask into a friendly reg exp string
|
164
165
|
t = @format_mask.to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
|
165
166
|
end
|
166
167
|
|
167
|
-
# convert the format mask into a friendly reg exp string
|
168
|
-
t = @format_mask.to_s.gsub(/\[!(\w+)\]/, '(.*)').sub(/\[/,'\[').sub(/\]/,'\]')
|
169
|
-
|
170
168
|
lines = buffer.strip.split(/\r?\n|\r(?!\n)/).map {|x|x.match(/#{t}/).captures}
|
171
169
|
|
172
170
|
a = lines.map do|x|
|