cureutils 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cureutils/cli.rb +7 -5
- data/lib/cureutils/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33299ec5caf69d03b6fb07e9460205cabdb4fa72
|
4
|
+
data.tar.gz: b12a44d2bfea16d16923e93da602ba7e0c212d9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04f8324ab4cfc50ee1d25080bbe0c9a2986dc3eaf6a04ccb10d5deda4f63eb063922840603641bee37698e4c2c0daeb537dc7b171858947d77ac5a69c495e61d
|
7
|
+
data.tar.gz: 59d1ff77aa4aa177c1194e149d3b3d5c7104c795581c58c13bb6d76ea352a654bd636df16d279b27c4138cd4215df582876e93be1186c1f36453059a4228807e
|
data/lib/cureutils/cli.rb
CHANGED
@@ -204,16 +204,13 @@ module Cureutils
|
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
|
-
|
207
|
+
# Convert string to precure regular expression
|
208
208
|
def pregex2regex(regex, br_flg = false)
|
209
209
|
this_regex = regex.dup
|
210
210
|
br_ex = br_flg ? '' : '?:'
|
211
211
|
%w(girl_name human_name precure_name cast_name color).each do |attr|
|
212
212
|
expression = '\[:' + attr + ':\]'
|
213
|
-
precures_ex = cure_list(attr.to_sym).
|
214
|
-
# Escape for cure princes.
|
215
|
-
elem_str.gsub(/\(/, '\(').gsub(/\)/, '\)')
|
216
|
-
end.join('|')
|
213
|
+
precures_ex = cure_list(attr.to_sym).join('|')
|
217
214
|
replaced = "(#{br_ex}#{precures_ex})"
|
218
215
|
this_regex.gsub!(/#{expression}/, replaced)
|
219
216
|
end
|
@@ -231,6 +228,11 @@ module Cureutils
|
|
231
228
|
def cure_list(sym)
|
232
229
|
list = Precure.all_stars.map(&sym)
|
233
230
|
list << Cure.echo[sym]
|
231
|
+
# Regulate cure princes human name
|
232
|
+
list.map do |str|
|
233
|
+
str.gsub!(/\(.+?\)/, '')
|
234
|
+
str
|
235
|
+
end
|
234
236
|
list
|
235
237
|
end
|
236
238
|
|
data/lib/cureutils/version.rb
CHANGED