meteor 0.9.44 → 0.9.45
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.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/Gemfile.lock +1 -1
- data/lib/meteor/core/kernel.rb +1 -1
- data/lib/meteor/element.rb +6 -2
- data/lib/meteor/ml/html4/parser_impl.rb +53 -41
- data/lib/meteor.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21bdbec821d662353316ee76eb7cc543b346e846038e559abf3f28767547ef76
|
|
4
|
+
data.tar.gz: 305b0b9321a7b42a09173e1c18bf31aa25117efa2873dcf03e37a19db416f7e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 83741d83f88f90a88af4908ddc796f24906667385f48c7c301292aa40eb1206663a8257f0fe7e225e66863626824a7817e50f9e9cb125671133ce03f32b43739
|
|
7
|
+
data.tar.gz: cbb0bbc96389681332574749f0092e6b9243f8be73a2429f5d7aa251f175725047655bf8c3408e2a0fb02e28f39e4bd8f0c7958107f5f665082b3a7838c3c788
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/lib/meteor/core/kernel.rb
CHANGED
|
@@ -453,7 +453,7 @@ module Meteor
|
|
|
453
453
|
private :element_pattern_three
|
|
454
454
|
|
|
455
455
|
def element_normal_three_one(name) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
456
|
-
# puts
|
|
456
|
+
# puts @res.captures.length
|
|
457
457
|
case @res.captures.length
|
|
458
458
|
when FOUR
|
|
459
459
|
# element (要素)
|
data/lib/meteor/element.rb
CHANGED
|
@@ -216,10 +216,14 @@ module Meteor
|
|
|
216
216
|
# get document (ドキュメントを取得する)
|
|
217
217
|
# @return [String] document (ドキュメント)
|
|
218
218
|
#
|
|
219
|
-
def document # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
|
219
|
+
def document # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/AbcSize
|
|
220
220
|
if @document_sync
|
|
221
221
|
@document_sync = false
|
|
222
|
-
@_mixed_content =
|
|
222
|
+
@_mixed_content = if @mixed_content
|
|
223
|
+
childless ? Regexp.quote(@mixed_content) : @mixed_content
|
|
224
|
+
else
|
|
225
|
+
''
|
|
226
|
+
end
|
|
223
227
|
case @parser.doc_type
|
|
224
228
|
when Parser::HTML, Parser::HTML4
|
|
225
229
|
@document = if @cx
|
|
@@ -307,61 +307,46 @@ module Meteor
|
|
|
307
307
|
# @param [String] attr_value2 attribute value2 (属性値2)
|
|
308
308
|
# @return [Meteor::Element] element (要素)
|
|
309
309
|
#
|
|
310
|
-
def element_five(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
310
|
+
def element_five(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
311
311
|
quote_name(name)
|
|
312
312
|
quote_attribute_one_two(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
313
313
|
|
|
314
314
|
# case of void element (空要素の場合(<->内容あり要素の場合))
|
|
315
315
|
if match?(MATCH_TAG, name)
|
|
316
|
-
|
|
317
|
-
@pattern_cc = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>" # rubocop:disable Layout/LineLength
|
|
318
|
-
|
|
319
|
-
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
320
|
-
# void element search (空要素検索)
|
|
321
|
-
@res = @pattern.match(@root.document)
|
|
322
|
-
|
|
323
|
-
if @res
|
|
324
|
-
element_void_five(name)
|
|
325
|
-
else
|
|
326
|
-
if @error_check
|
|
327
|
-
puts(
|
|
328
|
-
Meteor::Exception::NoSuchElementException
|
|
329
|
-
.new(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
330
|
-
.message
|
|
331
|
-
)
|
|
332
|
-
end
|
|
333
|
-
|
|
334
|
-
@elm_ = nil
|
|
335
|
-
end
|
|
316
|
+
element_five_void(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
336
317
|
else
|
|
337
|
-
|
|
338
|
-
|
|
318
|
+
element_five_normal(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
319
|
+
end
|
|
339
320
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
@res = @pattern.match(@root.document)
|
|
321
|
+
@elm_
|
|
322
|
+
end
|
|
343
323
|
|
|
344
|
-
|
|
324
|
+
private :element_five
|
|
345
325
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
if @error_check
|
|
350
|
-
puts(
|
|
351
|
-
Meteor::Exception::NoSuchElementException
|
|
352
|
-
.new(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
353
|
-
.message
|
|
354
|
-
)
|
|
355
|
-
end
|
|
326
|
+
def element_five_void(name, attr_name1, attr_value1, attr_name2, attr_value2) # rubocop:disable Metrics/MethodLength
|
|
327
|
+
# void element search pattern (空要素検索パターン)
|
|
328
|
+
@pattern_cc = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>" # rubocop:disable Layout/LineLength
|
|
356
329
|
|
|
357
|
-
|
|
330
|
+
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
331
|
+
# void element search (空要素検索)
|
|
332
|
+
@res = @pattern.match(@root.document)
|
|
333
|
+
|
|
334
|
+
if @res
|
|
335
|
+
element_void_five(name)
|
|
336
|
+
else
|
|
337
|
+
if @error_check
|
|
338
|
+
puts(
|
|
339
|
+
Meteor::Exception::NoSuchElementException
|
|
340
|
+
.new(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
341
|
+
.message
|
|
342
|
+
)
|
|
358
343
|
end
|
|
359
|
-
end
|
|
360
344
|
|
|
361
|
-
|
|
345
|
+
@elm_ = nil
|
|
346
|
+
end
|
|
362
347
|
end
|
|
363
348
|
|
|
364
|
-
private :
|
|
349
|
+
private :element_five_void
|
|
365
350
|
|
|
366
351
|
def element_void_five(name)
|
|
367
352
|
element_void_five_one(name, '")[^<>]*)>')
|
|
@@ -369,6 +354,33 @@ module Meteor
|
|
|
369
354
|
|
|
370
355
|
private :element_void_five
|
|
371
356
|
|
|
357
|
+
def element_five_normal(name, attr_name1, attr_value1, attr_name2, attr_value2) # rubocop:disable Metrics/MethodLength
|
|
358
|
+
# normal element search pattern (内容あり要素検索パターン)
|
|
359
|
+
@pattern_cc = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>" # rubocop:disable Layout/LineLength
|
|
360
|
+
|
|
361
|
+
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
362
|
+
# search of normal element (内容あり要素検索)
|
|
363
|
+
@res = @pattern.match(@root.document)
|
|
364
|
+
|
|
365
|
+
@res = element_normal_five_two if !@res && !match?(MATCH_TAG_NNE, name)
|
|
366
|
+
|
|
367
|
+
if @res
|
|
368
|
+
element_normal_five_one(name)
|
|
369
|
+
else
|
|
370
|
+
if @error_check
|
|
371
|
+
puts(
|
|
372
|
+
Meteor::Exception::NoSuchElementException
|
|
373
|
+
.new(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
374
|
+
.message
|
|
375
|
+
)
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
@elm_ = nil
|
|
379
|
+
end
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
private :element_five_normal
|
|
383
|
+
|
|
372
384
|
#
|
|
373
385
|
# get element using attribute1,2(name="value") (属性1・属性2(属性名="属性値")で検索し、要素を取得する)
|
|
374
386
|
#
|
data/lib/meteor.rb
CHANGED
|
@@ -37,11 +37,11 @@ require 'meteor/ml/xml/parser_impl'
|
|
|
37
37
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
38
38
|
#
|
|
39
39
|
# @author Yasumasa Ashida
|
|
40
|
-
# @version 0.9.
|
|
40
|
+
# @version 0.9.45
|
|
41
41
|
#
|
|
42
42
|
|
|
43
43
|
module Meteor
|
|
44
|
-
VERSION = '0.9.
|
|
44
|
+
VERSION = '0.9.45'
|
|
45
45
|
|
|
46
46
|
# require 'fileutils'
|
|
47
47
|
|