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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebd554983ecc3081fd55707f6282c3a639609c5cd6e100b7e75d0e7c46b457bb
4
- data.tar.gz: 3c6734e06ac743d78871fc71efda67a3a1bbd9d6bac519563d02c45a4b90daee
3
+ metadata.gz: 21bdbec821d662353316ee76eb7cc543b346e846038e559abf3f28767547ef76
4
+ data.tar.gz: 305b0b9321a7b42a09173e1c18bf31aa25117efa2873dcf03e37a19db416f7e9
5
5
  SHA512:
6
- metadata.gz: da148763b7573f7700eac92e3873c45be1c3cc474e10aaf823c1725c178d54500553d7940d65d00ef62b183fd7b003ad5a101583ca2b847ec35466f754d110f1
7
- data.tar.gz: 1e1ab49831f262ea795e14d3e0a786cdfce3f63799888fda983fdb14d90e778bdd8d86d0c44b158c45e4fbea154d17938a605ff6b741190d41a3abd26f437f23
6
+ metadata.gz: 83741d83f88f90a88af4908ddc796f24906667385f48c7c301292aa40eb1206663a8257f0fe7e225e66863626824a7817e50f9e9cb125671133ce03f32b43739
7
+ data.tar.gz: cbb0bbc96389681332574749f0092e6b9243f8be73a2429f5d7aa251f175725047655bf8c3408e2a0fb02e28f39e4bd8f0c7958107f5f665082b3a7838c3c788
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.9.45 / 2026-08-05 Yasumasa Ashida <ys.ashida@gmail.com>
2
+
3
+ * Refactor Meteor::Ml::Html4::ParserImpl
4
+ * Fix Meteor::Element#document
5
+
1
6
  == 0.9.44 / 2026-07-26 Yasumasa Ashida <ys.ashida@gmail.com>
2
7
 
3
8
  * Refactor Meteor::Core::Kernel
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meteor (0.9.44)
4
+ meteor (0.9.45)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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 @res.captures.length
456
+ # puts @res.captures.length
457
457
  case @res.captures.length
458
458
  when FOUR
459
459
  # element (要素)
@@ -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 = @mixed_content ? Regexp.quote(@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) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
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
- # void element search pattern (空要素検索パターン)
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
- # normal element search pattern (内容あり要素検索パターン)
338
- @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
318
+ element_five_normal(name, attr_name1, attr_value1, attr_name2, attr_value2)
319
+ end
339
320
 
340
- @pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
341
- # search of normal element (内容あり要素検索)
342
- @res = @pattern.match(@root.document)
321
+ @elm_
322
+ end
343
323
 
344
- @res = element_normal_five_two if !@res && !match?(MATCH_TAG_NNE, name)
324
+ private :element_five
345
325
 
346
- if @res
347
- element_normal_five_one(name)
348
- else
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
- @elm_ = nil
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
- @elm_
345
+ @elm_ = nil
346
+ end
362
347
  end
363
348
 
364
- private :element_five
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.44
40
+ # @version 0.9.45
41
41
  #
42
42
 
43
43
  module Meteor
44
- VERSION = '0.9.44'
44
+ VERSION = '0.9.45'
45
45
 
46
46
  # require 'fileutils'
47
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meteor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.44
4
+ version: 0.9.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasumasa Ashida