asip-meteor 0.9.1.0 → 0.9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/meteor.rb +142 -98
- metadata +2 -2
data/lib/meteor.rb
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
19
19
|
#
|
20
20
|
# @author Yasumasa Ashida
|
21
|
-
# @version 0.9.1.
|
21
|
+
# @version 0.9.1.1
|
22
22
|
#
|
23
23
|
if RUBY_VERSION < '1.9.0' then
|
24
24
|
require 'kconv'
|
@@ -27,7 +27,7 @@ end
|
|
27
27
|
|
28
28
|
module Meteor
|
29
29
|
|
30
|
-
VERSION = "0.9.1.
|
30
|
+
VERSION = "0.9.1.1"
|
31
31
|
|
32
32
|
#
|
33
33
|
# 要素クラス
|
@@ -626,8 +626,8 @@ module Meteor
|
|
626
626
|
TAG_SEARCH_2_2 = '"[^<>]*)>(((?!('
|
627
627
|
TAG_SEARCH_2_2_2 = '")[^<>]*)>(((?!('
|
628
628
|
TAG_SEARCH_2_3 = '"[^<>]*)'
|
629
|
-
TAG_SEARCH_2_3_2 = "
|
630
|
-
TAG_SEARCH_2_3_2_2 = "
|
629
|
+
TAG_SEARCH_2_3_2 = '"[^<>]*)\\/>'
|
630
|
+
TAG_SEARCH_2_3_2_2 = '")[^<>]*)\\/>'
|
631
631
|
#TAG_SEARCH_2_4 = "\"[^<>\\/]*>"
|
632
632
|
TAG_SEARCH_2_4 = '(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
633
633
|
#TAG_SEARCH_2_4_2 = "\"[^<>\\/]*)>"
|
@@ -1038,8 +1038,10 @@ module Meteor
|
|
1038
1038
|
@res1 = @pattern.match(@root.document)
|
1039
1039
|
|
1040
1040
|
#内容あり要素検索用パターン
|
1041
|
-
|
1042
|
-
|
1041
|
+
#@pattern_cc_2 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_1_1 << elmName
|
1042
|
+
#@pattern_cc_2 << TAG_SEARCH_1_2 << @_elmName << TAG_CLOSE
|
1043
|
+
@pattern_cc_2 = "<#{@_elmName}(\\s?[^<>]*)>(((?!(#{elmName}[^<>]*>)).)*)<\\/#{elmName}>"
|
1044
|
+
|
1043
1045
|
|
1044
1046
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
|
1045
1047
|
#内容あり要素検索
|
@@ -1082,9 +1084,10 @@ module Meteor
|
|
1082
1084
|
#全体
|
1083
1085
|
@elm_.document = @res[0]
|
1084
1086
|
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1087
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_NC_1_1 << elmName
|
1088
|
+
#@pattern_cc << TAG_SEARCH_NC_1_2 << @_elmName << TAG_CLOSE
|
1089
|
+
@pattern_cc = "<#{@_elmName}\\s?[^<>]*>((?!(#{@_elmName}[^<>]*>)).)*<\\/#{@_elmName}>"
|
1090
|
+
|
1088
1091
|
#内容あり要素検索用パターン
|
1089
1092
|
@elm_.pattern = @pattern_cc
|
1090
1093
|
|
@@ -1130,16 +1133,20 @@ module Meteor
|
|
1130
1133
|
@_attrValue = escapeRegex(attrValue)
|
1131
1134
|
|
1132
1135
|
#空要素検索用パターン
|
1133
|
-
|
1134
|
-
|
1136
|
+
#@pattern_cc_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
|
1137
|
+
#@pattern_cc_1 << @_attrValue << TAG_SEARCH_2_3_2
|
1138
|
+
@pattern_cc_1 = "<#{@_elmName}(\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"[^<>]*)\\/>"
|
1139
|
+
|
1135
1140
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_1)
|
1136
1141
|
#空要素検索
|
1137
1142
|
@res1 = @pattern.match(@root.document)
|
1138
1143
|
|
1139
1144
|
#内容あり要素検索パターン
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1145
|
+
#@pattern_cc_2 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
|
1146
|
+
#@pattern_cc_2 << @_attrValue << TAG_SEARCH_2_2 << @_elmName
|
1147
|
+
#@pattern_cc_2 << TAG_SEARCH_1_2 << @_elmName << TAG_CLOSE
|
1148
|
+
@pattern_cc_2 = "<#{@_elmName}(\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"[^<>]*)>(((?!(#{@_elmName}[^<>]*>)).)*)<\\/#{@_elmName}>"
|
1149
|
+
|
1143
1150
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
|
1144
1151
|
#内容あり要素検索
|
1145
1152
|
@res2 = @pattern.match(@root.document)
|
@@ -1193,9 +1200,11 @@ module Meteor
|
|
1193
1200
|
#全体
|
1194
1201
|
@elm_.document = @res[0]
|
1195
1202
|
#内容あり要素検索用パターン
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1203
|
+
#@pattern_cc = ''<< TAG_OPEN << @_elmName << TAG_SEARCH_NC_2_1 << @_attrName << ATTR_EQ
|
1204
|
+
#@pattern_cc << @_attrValue << TAG_SEARCH_NC_2_2 << @_elmName
|
1205
|
+
#@pattern_cc << TAG_SEARCH_NC_1_2 << @_elmName << TAG_CLOSE
|
1206
|
+
@pattern_cc = "<#{@_elmName}\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"[^<>]*>((?!(#{@_elmName}[^<>]*>)).)*<\\/#{@_elmName}>"
|
1207
|
+
|
1199
1208
|
@elm_.pattern = @pattern_cc
|
1200
1209
|
|
1201
1210
|
@elm_.empty = true
|
@@ -1223,13 +1232,15 @@ module Meteor
|
|
1223
1232
|
|
1224
1233
|
def elementWithContent_3_2(elmName)
|
1225
1234
|
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1235
|
+
#@pattern_cc_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
|
1236
|
+
#@pattern_cc_1 << @_attrValue << TAG_SEARCH_2_4_2
|
1237
|
+
@pattern_cc_1 = "<#{@_elmName}(\\s[^<>]*#{@_attrName}=\"#{@_attrValue}(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))"
|
1238
|
+
|
1229
1239
|
@pattern_cc_1b = '' << TAG_OPEN << @_elmName << TAG_SEARCH_1_4
|
1230
1240
|
|
1231
|
-
|
1232
|
-
|
1241
|
+
#@pattern_cc_1_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
|
1242
|
+
#@pattern_cc_1_1 << @_attrValue << TAG_SEARCH_4_7
|
1243
|
+
@pattern_cc_1_1 = "<#{@_elmName}(\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
|
1233
1244
|
|
1234
1245
|
@pattern_cc_1_2 = '' << TAG_SEARCH_4_2 << @_elmName << TAG_SEARCH_4_3
|
1235
1246
|
|
@@ -1299,8 +1310,10 @@ module Meteor
|
|
1299
1310
|
@_attrName = escapeRegex(attrName)
|
1300
1311
|
@_attrValue = escapeRegex(attrValue)
|
1301
1312
|
|
1302
|
-
|
1303
|
-
|
1313
|
+
##@pattern_cc = '' << TAG_SEARCH_3_1 << @_attrName << ATTR_EQ << @_attrValue << TAG_SEARCH_2_4
|
1314
|
+
#@pattern_cc = '' << TAG_SEARCH_3_1 << @_attrName << ATTR_EQ << @_attrValue << TAG_SEARCH_2_4_2_3
|
1315
|
+
@pattern_cc = "<([^<>\"]*)\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\""
|
1316
|
+
|
1304
1317
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
1305
1318
|
|
1306
1319
|
@res = @pattern.match(@root.document)
|
@@ -1334,22 +1347,26 @@ module Meteor
|
|
1334
1347
|
@_attrValue2 = escapeRegex(attrValue2)
|
1335
1348
|
|
1336
1349
|
#空要素検索用パターン
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1350
|
+
#@pattern_cc_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
|
1351
|
+
#@pattern_cc_1 << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
1352
|
+
#@pattern_cc_1 << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
1353
|
+
#@pattern_cc_1 << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
1354
|
+
#@pattern_cc_1 << @_attrValue1 << TAG_SEARCH_2_3_2_2
|
1355
|
+
@pattern_cc_1 = "<#{@_elmName}(\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")[^<>]*)\\/>"
|
1356
|
+
|
1342
1357
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_1)
|
1343
1358
|
#空要素検索
|
1344
1359
|
@res1 = @pattern.match(@root.document)
|
1345
1360
|
|
1346
1361
|
#内容あり要素検索パターン
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1362
|
+
#@pattern_cc_2 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
|
1363
|
+
#@pattern_cc_2 << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
1364
|
+
#@pattern_cc_2 << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
1365
|
+
#@pattern_cc_2 << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
1366
|
+
#@pattern_cc_2 << @_attrValue1 << TAG_SEARCH_2_2_2 << @_elmName
|
1367
|
+
#@pattern_cc_2 << TAG_SEARCH_1_2 << @_elmName << TAG_CLOSE
|
1368
|
+
@pattern_cc_1 = "<#{@_elmName}(\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")[^<>]*)>(((?!(#{@_elmName}[^<>]*>)).)*)<\\/#{@_elmName}>"
|
1369
|
+
|
1353
1370
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
|
1354
1371
|
#内容あり要素検索
|
1355
1372
|
@res2 = @pattern.match(@root.document)
|
@@ -1404,12 +1421,14 @@ module Meteor
|
|
1404
1421
|
#全体
|
1405
1422
|
@elm_.document = @res[0]
|
1406
1423
|
#内容あり要素検索用パターン
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1424
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_NC_2_1_2 << @_attrName1 << ATTR_EQ
|
1425
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_NC_2_6 << @_attrName2 << ATTR_EQ
|
1426
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_NC_2_7 << @_attrName2 << ATTR_EQ
|
1427
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_NC_2_6 << @_attrName1 << ATTR_EQ
|
1428
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_NC_2_2_2 << @_elmName
|
1429
|
+
#@pattern_cc << TAG_SEARCH_NC_1_2 << @_elmName << TAG_CLOSE
|
1430
|
+
@pattern_cc = "<#{@_elmName}\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")[^<>]*>((?!(#{@_elmName}[^<>]*>)).)*<\\/#{@_elmName}>"
|
1431
|
+
|
1413
1432
|
@elm_.pattern = @pattern_cc
|
1414
1433
|
#
|
1415
1434
|
@elm_.empty = true
|
@@ -1437,20 +1456,22 @@ module Meteor
|
|
1437
1456
|
|
1438
1457
|
def elementWithContent_5_2(elmName)
|
1439
1458
|
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1459
|
+
#@pattern_cc_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
|
1460
|
+
#@pattern_cc_1 << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
1461
|
+
#@pattern_cc_1 << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
1462
|
+
#@pattern_cc_1 << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
1463
|
+
#@pattern_cc_1 << @_attrValue1 << TAG_SEARCH_2_4_2_2
|
1464
|
+
@pattern_cc_1 = "<#{@_elmName}(\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))"
|
1465
|
+
|
1446
1466
|
@pattern_cc_1b = '' << TAG_OPEN << elmName << TAG_SEARCH_1_4
|
1447
1467
|
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1468
|
+
#@pattern_cc_1_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
|
1469
|
+
#@pattern_cc_1_1 << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
1470
|
+
#@pattern_cc_1_1 << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
1471
|
+
#@pattern_cc_1_1 << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
1472
|
+
#@pattern_cc_1_1 << @_attrValue1 << TAG_SEARCH_4_7_2
|
1473
|
+
@pattern_cc_1 = "<#{@_elmName}(\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
|
1474
|
+
|
1454
1475
|
@pattern_cc_1_2 = '' << TAG_SEARCH_4_2 << @_elmName << TAG_SEARCH_4_3
|
1455
1476
|
|
1456
1477
|
@pattern_cc_2 = '' << TAG_SEARCH_4_4 << @_elmName << TAG_CLOSE
|
@@ -1499,11 +1520,13 @@ module Meteor
|
|
1499
1520
|
#全体
|
1500
1521
|
@elm_.document = @res[0]
|
1501
1522
|
#空要素検索用パターン
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1523
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_NC_2_1_2 << @_attrName1 << ATTR_EQ
|
1524
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_NC_2_6 << @_attrName2 << ATTR_EQ
|
1525
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_NC_2_7 << @_attrName2 << ATTR_EQ
|
1526
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_NC_2_6 << @_attrName1 << ATTR_EQ
|
1527
|
+
#@pattern_cc << @_attrValue1 << closer
|
1528
|
+
@pattern_cc = "<#{@_elmName}\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}#{closer}"
|
1529
|
+
|
1507
1530
|
@elm_.pattern = @pattern_cc
|
1508
1531
|
|
1509
1532
|
@elm_.parser = self
|
@@ -1526,11 +1549,12 @@ module Meteor
|
|
1526
1549
|
@_attrValue1 = escapeRegex(attrValue1)
|
1527
1550
|
@_attrValue2 = escapeRegex(attrValue2)
|
1528
1551
|
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1552
|
+
#@pattern_cc = '' << TAG_SEARCH_3_1_2_2 << @_attrName1 << ATTR_EQ
|
1553
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
1554
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
1555
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
1556
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_2_4_2_3
|
1557
|
+
@pattern_cc = "<([^<>\"]*)\\s([^<>]*(#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\""
|
1534
1558
|
|
1535
1559
|
@pattern = PatternCache.get(@pattern_cc)
|
1536
1560
|
|
@@ -1827,7 +1851,8 @@ module Meteor
|
|
1827
1851
|
elm.attributes = ''
|
1828
1852
|
end
|
1829
1853
|
|
1830
|
-
elm.attributes << SPACE << attrName << ATTR_EQ << @_attrValue << DOUBLE_QUATATION
|
1854
|
+
#elm.attributes << SPACE << attrName << ATTR_EQ << @_attrValue << DOUBLE_QUATATION
|
1855
|
+
elm.attributes << " #{attrName}=\"#{@_attrValue}\""
|
1831
1856
|
end
|
1832
1857
|
|
1833
1858
|
end
|
@@ -2233,8 +2258,9 @@ module Meteor
|
|
2233
2258
|
def cxtag_2(elmName,id)
|
2234
2259
|
|
2235
2260
|
#CXタグ検索用パターン
|
2236
|
-
|
2237
|
-
|
2261
|
+
#@pattern_cc = '' << SEARCH_CX_1 << elmName << SEARCH_CX_2
|
2262
|
+
#@pattern_cc << id << SEARCH_CX_3 << elmName << SEARCH_CX_4 << elmName << SEARCH_CX_5
|
2263
|
+
@pattern_cc = "<!--\\s@#{elmName}\\s([^<>]*id=\"#{id}\"[^<>]*)-->(((?!(<!--\\s\\/@#{elmName})).)*)<!--\\s\\/@#{elmName}\\s-->"
|
2238
2264
|
|
2239
2265
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
2240
2266
|
#CXタグ検索
|
@@ -3041,8 +3067,9 @@ module Meteor
|
|
3041
3067
|
end
|
3042
3068
|
else
|
3043
3069
|
#内容あり要素検索用パターン
|
3044
|
-
|
3045
|
-
|
3070
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_1_1 << elmName
|
3071
|
+
#@pattern_cc << TAG_SEARCH_1_2 << @_elmName << TAG_CLOSE
|
3072
|
+
@pattern_cc = "<#{elmName}(\\s?[^<>]*)>(((?!(#{elmName}[^<>]*>)).)*)<\\/#{elmName}>"
|
3046
3073
|
|
3047
3074
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
3048
3075
|
#内容あり要素検索
|
@@ -3088,8 +3115,10 @@ module Meteor
|
|
3088
3115
|
#空要素の場合(<->内容あり要素の場合)
|
3089
3116
|
if isMatch(MATCH_TAG,elmName) then
|
3090
3117
|
#空要素検索パターン
|
3091
|
-
|
3092
|
-
|
3118
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
|
3119
|
+
#@pattern_cc << @_attrValue << TAG_SEARCH_2_4_3
|
3120
|
+
@pattern_cc = "<#{@_elmName}(\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"[^<>]*)>"
|
3121
|
+
|
3093
3122
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
3094
3123
|
#空要素検索
|
3095
3124
|
@res = @pattern.match(@root.document)
|
@@ -3100,9 +3129,11 @@ module Meteor
|
|
3100
3129
|
end
|
3101
3130
|
else
|
3102
3131
|
#内容あり要素検索パターン
|
3103
|
-
|
3104
|
-
|
3105
|
-
|
3132
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
|
3133
|
+
#@pattern_cc << @_attrValue << TAG_SEARCH_2_2 << @_elmName
|
3134
|
+
#@pattern_cc << TAG_SEARCH_1_2 << @_elmName << TAG_CLOSE
|
3135
|
+
@pattern_cc = "<#{@_elmName}(\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"[^<>]*)>(((?!(#{@_elmName}[^<>]*>)).)*)<\\/#{@_elmName}>"
|
3136
|
+
|
3106
3137
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
3107
3138
|
#内容あり要素検索
|
3108
3139
|
@res = @pattern.match(@root.document)
|
@@ -3143,8 +3174,10 @@ module Meteor
|
|
3143
3174
|
@_attrName = escapeRegex(attrName)
|
3144
3175
|
@_attrValue = escapeRegex(attrValue)
|
3145
3176
|
|
3146
|
-
|
3147
|
-
|
3177
|
+
#@pattern_cc = '' << TAG_SEARCH_3_1 << @_attrName << ATTR_EQ << @_attrValue
|
3178
|
+
#@pattern_cc << TAG_SEARCH_2_4_4
|
3179
|
+
@pattern_cc = "<([^<>\"]*)\\s[^<>]*#{@_attrName}=\"#{@_attrValue}\"[^<>]*>"
|
3180
|
+
|
3148
3181
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
3149
3182
|
@res = @pattern.match(@root.document)
|
3150
3183
|
|
@@ -3179,11 +3212,13 @@ module Meteor
|
|
3179
3212
|
#空要素の場合(<->内容あり要素の場合)
|
3180
3213
|
if isMatch(MATCH_TAG,elmName) then
|
3181
3214
|
#空要素検索パターン
|
3182
|
-
|
3183
|
-
|
3184
|
-
|
3185
|
-
|
3186
|
-
|
3215
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
|
3216
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
3217
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
3218
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
3219
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_2_4_3_2
|
3220
|
+
@pattern_cc = "<#{@_elmName}(\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")[^<>]*)>"
|
3221
|
+
|
3187
3222
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
3188
3223
|
#空要素検索
|
3189
3224
|
@res = @pattern.match(@root.document)
|
@@ -3195,12 +3230,14 @@ module Meteor
|
|
3195
3230
|
end
|
3196
3231
|
else
|
3197
3232
|
#内容あり要素検索パターン
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3233
|
+
#@pattern_cc = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
|
3234
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
|
3235
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
|
3236
|
+
#@pattern_cc << @_attrValue2 << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ
|
3237
|
+
#@pattern_cc << @_attrValue1 << TAG_SEARCH_2_2_2 << @_elmName
|
3238
|
+
#@pattern_cc << TAG_SEARCH_1_2 << @_elmName << TAG_CLOSE
|
3239
|
+
@pattern_cc = "<#{@_elmName}(\\s[^<>]*(?:#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")[^<>]*)>(((?!(#{@_elmName}[^<>]*>)).)*)<\\/#{@_elmName}>"
|
3240
|
+
|
3204
3241
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
3205
3242
|
#内容あり要素検索
|
3206
3243
|
@res = @pattern.match(@root.document)
|
@@ -3246,13 +3283,14 @@ module Meteor
|
|
3246
3283
|
@_attrName2 = escapeRegex(attrName2)
|
3247
3284
|
@_attrValue2 = escapeRegex(attrValue2)
|
3248
3285
|
|
3249
|
-
|
3250
|
-
|
3251
|
-
|
3252
|
-
|
3253
|
-
|
3286
|
+
#@pattern_cc = '' << TAG_SEARCH_3_1_2_2 << @_attrName1 << ATTR_EQ << @_attrValue1
|
3287
|
+
#@pattern_cc << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ << @_attrValue2
|
3288
|
+
#@pattern_cc << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ << @_attrValue2
|
3289
|
+
#@pattern_cc << TAG_SEARCH_2_6 << @_attrName1 << ATTR_EQ << @_attrValue1
|
3290
|
+
#@pattern_cc << TAG_SEARCH_2_4_3_2
|
3291
|
+
@pattern_CC = @pattern_cc = "<([^<>\"]*)\\s([^<>]*(#{@_attrName1}=\"#{@_attrValue1}\"[^<>]*#{@_attrName2}=\"#{@_attrValue2}\"|#{@_attrName2}=\"#{@_attrValue2}\"[^<>]*#{@_attrName1}=\"#{@_attrValue1}\")[^<>]*)>"
|
3254
3292
|
|
3255
|
-
@pattern =
|
3293
|
+
@pattern = PatternCache.get(@pattern_cc)
|
3256
3294
|
|
3257
3295
|
@res = @pattern.match(@root.document)
|
3258
3296
|
|
@@ -3407,10 +3445,12 @@ module Meteor
|
|
3407
3445
|
if @res then
|
3408
3446
|
elm.mono = true
|
3409
3447
|
if elm.cx then
|
3410
|
-
|
3448
|
+
#@pattern_cc = '' << SET_CX_1 << elm.name << SPACE << elm.attributes << SET_CX_2 << elm.mixed_content << SET_CX_3 << elm.name << SET_CX_4
|
3449
|
+
@pattern_cc = "<!-- @#{elmName} #{elm.attributes} -->#{elm.mixed_content}<!-- /@#{elm.name} -->"
|
3411
3450
|
else
|
3412
3451
|
if elm.empty then
|
3413
|
-
|
3452
|
+
#@pattern_cc = '' << TAG_OPEN << elm.name << elm.attributes << TAG_CLOSE << elm.mixed_content << TAG_OPEN3 << elm.name << TAG_CLOSE
|
3453
|
+
@pattern_cc = "<#{elm.name}#{elm.attributes}>#{elm.mixed_content}</#{elm.name}>"
|
3414
3454
|
else
|
3415
3455
|
@pattern_cc = '' << TAG_OPEN << elm.name << elm.attributes << TAG_CLOSE
|
3416
3456
|
end
|
@@ -3917,10 +3957,12 @@ module Meteor
|
|
3917
3957
|
if @res then
|
3918
3958
|
elm.mono = true
|
3919
3959
|
if elm.cx then
|
3920
|
-
|
3960
|
+
#@pattern_cc = '' << SET_CX_1 << elm.name << SPACE << elm.attributes << SET_CX_2 << elm.mixed_content << SET_CX_3 << elm.name << SET_CX_4
|
3961
|
+
@pattern_cc = "<!-- @#{elmName} #{elm.attributes} -->#{elm.mixed_content}<!-- /@#{elm.name} -->"
|
3921
3962
|
else
|
3922
3963
|
if elm.empty then
|
3923
|
-
|
3964
|
+
#@pattern_cc = '' << TAG_OPEN << elm.name << elm.attributes << TAG_CLOSE << elm.mixed_content << TAG_OPEN3 << elm.name << TAG_CLOSE
|
3965
|
+
@pattern_cc = "<#{elm.name}#{elm.attributes}>#{elm.mixed_content}</#{elm.name}>"
|
3924
3966
|
else
|
3925
3967
|
@pattern_cc = '' << TAG_OPEN << elm.name << elm.attributes << TAG_CLOSE3
|
3926
3968
|
end
|
@@ -4140,10 +4182,12 @@ module Meteor
|
|
4140
4182
|
if @res then
|
4141
4183
|
elm.mono = true
|
4142
4184
|
if elm.cx then
|
4143
|
-
|
4185
|
+
#@pattern_cc = '' << SET_CX_1 << elm.name << SPACE << elm.attributes << SET_CX_2 << elm.mixed_content << SET_CX_3 << elm.name << SET_CX_4
|
4186
|
+
@pattern_cc = "<!-- @#{elmName} #{elm.attributes} -->#{elm.mixed_content}<!-- /@#{elm.name} -->"
|
4144
4187
|
else
|
4145
4188
|
if elm.empty then
|
4146
|
-
|
4189
|
+
#@pattern_cc = '' << TAG_OPEN << elm.name << elm.attributes << TAG_CLOSE << elm.mixed_content << TAG_OPEN3 << elm.name << TAG_CLOSE
|
4190
|
+
@pattern_cc = "<#{elm.name}#{elm.attributes}>#{elm.mixed_content}</#{elm.name}>"
|
4147
4191
|
else
|
4148
4192
|
@pattern_cc = '' << TAG_OPEN << elm.name << elm.attributes << TAG_CLOSE3
|
4149
4193
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asip-meteor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.1.
|
4
|
+
version: 0.9.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- asip
|
@@ -9,7 +9,7 @@ autorequire: meteor
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|