meteor 0.9.40 → 0.9.41
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 +4 -0
- data/Gemfile.lock +3 -3
- data/lib/meteor/core/kernel.rb +5 -79
- data/lib/meteor/element.rb +1 -9
- data/lib/meteor/ml/html4/parser_impl.rb +0 -25
- data/lib/meteor.rb +2 -2
- data/meteor.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46eb97e00adae645d7675426b601a1f1d90ef372aad0c4106d169b86bbb72b46
|
|
4
|
+
data.tar.gz: efa01e2a273c17a070986389581b032cbfc1cd64e47164cf247f675fcdde5554
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7d915e4808fe38ce59fb1d127b534cb18a2c1c627742031185bb20f6ba32aeb67dec856dfdb042854ce9a0b6775111191ea2c031463a2cf8c7f75f2cf6a3de9
|
|
7
|
+
data.tar.gz: 9a030a41653d7c0c69ad35c37355ef8acfdd406f7679e36c7fcf7d039326c21b32e86ed9ed173b588d37c430e776c9647c0aff253361ce97344f17b128da65bd
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
meteor (0.9.
|
|
4
|
+
meteor (0.9.41)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
@@ -41,9 +41,9 @@ PLATFORMS
|
|
|
41
41
|
ruby
|
|
42
42
|
|
|
43
43
|
DEPENDENCIES
|
|
44
|
-
bundler (~> 4.0.
|
|
44
|
+
bundler (~> 4.0.16)
|
|
45
45
|
meteor!
|
|
46
46
|
rubocop (~> 1.88.2)
|
|
47
47
|
|
|
48
48
|
BUNDLED WITH
|
|
49
|
-
4.0.
|
|
49
|
+
4.0.16
|
data/lib/meteor/core/kernel.rb
CHANGED
|
@@ -330,8 +330,6 @@ module Meteor
|
|
|
330
330
|
end
|
|
331
331
|
@elm_.document = @res[0]
|
|
332
332
|
# normal element search pattern (内容あり要素検索用パターン)
|
|
333
|
-
# @pattern_cc = String.new('') << "<" << @_name << '(?:|\\s[^<>]*)>((?!(' << @_name
|
|
334
|
-
# @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
335
333
|
@pattern_cc = "<#{@_name}(|\\s[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
|
|
336
334
|
|
|
337
335
|
@elm_.pattern = @pattern_cc
|
|
@@ -454,9 +452,6 @@ module Meteor
|
|
|
454
452
|
# document (全体)
|
|
455
453
|
@elm_.document = @res[0]
|
|
456
454
|
# normal element search pattern (内容あり要素検索用パターン)
|
|
457
|
-
# @pattern_cc = String.new('')<< "<" << @_name << '\\s[^<>]*' << @_attr_name << '="'
|
|
458
|
-
# @pattern_cc << @_attr_value << '"[^<>]*>((?!(' << @_name
|
|
459
|
-
# @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
460
455
|
@pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>" # rubocop:disable Layout/LineLength
|
|
461
456
|
|
|
462
457
|
@elm_.pattern = @pattern_cc
|
|
@@ -474,9 +469,6 @@ module Meteor
|
|
|
474
469
|
# document (全体)
|
|
475
470
|
@elm_.document = @res[0]
|
|
476
471
|
# normal element search pattern (内容あり要素検索用パターン)
|
|
477
|
-
# @pattern_cc = String.new('')<< "<" << @_name << '\\s[^<>]*' << @_attr_name << '="'
|
|
478
|
-
# @pattern_cc << @_attr_value << '"[^<>]*>((?!(' << @_name
|
|
479
|
-
# @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
480
472
|
@pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*)>((?!(#{@_name}[^<>]*>)).)*<\\/#{@_name}>" # rubocop:disable Layout/LineLength
|
|
481
473
|
|
|
482
474
|
@elm_.pattern = @pattern_cc
|
|
@@ -526,13 +518,9 @@ module Meteor
|
|
|
526
518
|
private :element_normal_three_two
|
|
527
519
|
|
|
528
520
|
def element_pattern_normal_three_two # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
529
|
-
# @pattern_cc_one = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
|
|
530
|
-
# @pattern_cc_one << @_attr_value << '(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))'
|
|
531
521
|
@pattern_cc_one = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))" # rubocop:disable Layout/LineLength
|
|
532
522
|
@pattern_cc_oneb = String.new('') << '<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
533
523
|
# @pattern_cc_oneb = "<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
|
|
534
|
-
# @pattern_cc_one_one = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
|
|
535
|
-
# @pattern_cc_one_one << @_attr_value << '"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
|
|
536
524
|
@pattern_cc_one_one = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))(" # rubocop:disable Layout/LineLength
|
|
537
525
|
@pattern_cc_one_two = String.new('') << '.*?<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
538
526
|
# @pattern_cc_one_two = ".*?<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
|
|
@@ -575,8 +563,6 @@ module Meteor
|
|
|
575
563
|
# document (全体)
|
|
576
564
|
@elm_.document = @res[0]
|
|
577
565
|
# pattern (空要素検索用パターン)
|
|
578
|
-
# @pattern_cc = String.new("") << "<" << @_name << "(\\s[^<>]*"
|
|
579
|
-
# << @_attr_name << "=\"" << @_attr_value << closer
|
|
580
566
|
@pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}#{closer}"
|
|
581
567
|
@elm_.pattern = @pattern_cc
|
|
582
568
|
@elm_.parser = self
|
|
@@ -673,10 +659,8 @@ module Meteor
|
|
|
673
659
|
private :quote_attribute
|
|
674
660
|
|
|
675
661
|
def element_pattern_two
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
# @pattern_cc = String.new('') << '<([^<>"]*)\\s[^<>]*'
|
|
679
|
-
# << @_attr_name << '="' << @_attr_value << '"'
|
|
662
|
+
## @pattern_cc = String.new('') << '<([^<>"]*)\\s[^<>]*'
|
|
663
|
+
## << @_attr_name << '="' << @_attr_value << '(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
680
664
|
@pattern_cc = "<([^<>\"]*)\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\""
|
|
681
665
|
end
|
|
682
666
|
|
|
@@ -696,9 +680,6 @@ module Meteor
|
|
|
696
680
|
# # document (全体)
|
|
697
681
|
# @elm_.document = @res[0]
|
|
698
682
|
# # pattern (内容あり要素検索用パターン)
|
|
699
|
-
# # @pattern_cc = String.new('') << "<" << @_name << '\\s[^<>]*' << @_attr_name << '="'
|
|
700
|
-
# # @pattern_cc << @_attr_value << '"[^<>]*>((?!(' << @_name
|
|
701
|
-
# # @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
702
683
|
# @ pattern_cc = "<#{@_name}\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*>((?!(#{@_name}[^<>]*>)).)*<\\/#{@_name}>" # rubocop:disable Layout/LineLength
|
|
703
684
|
#
|
|
704
685
|
# @elm_.pattern = @pattern_cc
|
|
@@ -715,9 +696,6 @@ module Meteor
|
|
|
715
696
|
# # document (全体)
|
|
716
697
|
# @elm_.document = @res[0]
|
|
717
698
|
# # pattern (内容あり要素検索用パターン)
|
|
718
|
-
# # @pattern_cc = String.new()<< "<" << @_name << '\\s[^<>]*' << @_attr_name << '="'
|
|
719
|
-
# # @pattern_cc << @_attr_value << '"[^<>]*>((?!(' << @_name
|
|
720
|
-
# # @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
721
699
|
# @pattern_cc = "<#{@_name}\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*>((?!(#{@_name}[^<>]*>)).)*<\\/#{@_name}>" # rubocop:disable Layout/LineLength
|
|
722
700
|
#
|
|
723
701
|
# @elm_.pattern = @pattern_cc
|
|
@@ -747,8 +725,6 @@ module Meteor
|
|
|
747
725
|
# private :element_normal_two_one
|
|
748
726
|
#
|
|
749
727
|
# def element_normal_two_two
|
|
750
|
-
# # @pattern_cc_one = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
|
|
751
|
-
# # @pattern_cc_one << @_attr_value << '(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))'
|
|
752
728
|
# @pattern_cc_one = "<([^<>\"]*)(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))" # rubocop:disable Layout/LineLength
|
|
753
729
|
#
|
|
754
730
|
# # search of normal element (内容あり要素検索)
|
|
@@ -774,8 +750,6 @@ module Meteor
|
|
|
774
750
|
# def create_pattern_two(args_cnt)
|
|
775
751
|
# @pattern_cc_oneb = String.new('') << "<" << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
776
752
|
#
|
|
777
|
-
# # @pattern_cc_one_one = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
|
|
778
|
-
# # @pattern_cc_one_one << @_attr_value << '"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
|
|
779
753
|
# @pattern_cc_one_one = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))(" # rubocop:disable Layout/LineLength
|
|
780
754
|
# @pattern_cc_one_two = String.new('') << '.*?<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
781
755
|
# @pattern_cc_two = String.new('') << '<\\/' << @_name << '>'
|
|
@@ -894,12 +868,6 @@ module Meteor
|
|
|
894
868
|
# document (全体)
|
|
895
869
|
@elm_.document = @res[0]
|
|
896
870
|
# pattern (内容あり要素検索用パターン)
|
|
897
|
-
# @pattern_cc = String.new('') << "<" << @_name << '\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
898
|
-
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
899
|
-
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
900
|
-
# @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
901
|
-
# @pattern_cc << @_attr_value1 << '")[^<>]*>((?!(' << @_name
|
|
902
|
-
# @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
903
871
|
@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
|
|
904
872
|
|
|
905
873
|
@elm_.pattern = @pattern_cc
|
|
@@ -915,12 +883,6 @@ module Meteor
|
|
|
915
883
|
# documement (全体)
|
|
916
884
|
@elm_.document = @res[0]
|
|
917
885
|
# pattern (内容あり要素検索用パターン)
|
|
918
|
-
# @pattern_cc = String.new('') << "<" << @_name << '\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
919
|
-
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
920
|
-
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
921
|
-
# @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
922
|
-
# @pattern_cc << @_attr_value1 << '")[^<>]*>((?!(' << @_name
|
|
923
|
-
# @pattern_cc << '[^<>]*>)).)*<\\/' << @_name << '>'
|
|
924
886
|
@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
|
|
925
887
|
|
|
926
888
|
@elm_.pattern = @pattern_cc
|
|
@@ -962,20 +924,10 @@ module Meteor
|
|
|
962
924
|
private :element_normal_five_two
|
|
963
925
|
|
|
964
926
|
def element_pattern_normal_five_two # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
965
|
-
# @pattern_cc_one = String.new('') << "<" << @_name << '(\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
966
|
-
# @pattern_cc_one << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
967
|
-
# @pattern_cc_one << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
968
|
-
# @pattern_cc_one << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
969
|
-
# @pattern_cc_one << @_attr_value1 << '")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))'
|
|
970
927
|
@pattern_cc_one = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))" # rubocop:disable Layout/LineLength
|
|
971
928
|
@pattern_cc_oneb = String.new('') << '<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
972
929
|
# @pattern_cc_oneb = "<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
|
|
973
930
|
|
|
974
|
-
# @pattern_cc_one_one = String.new('') << "<" << @_name << '(\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
975
|
-
# @pattern_cc_one_one << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
976
|
-
# @pattern_cc_one_one << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
977
|
-
# @pattern_cc_one_one << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
978
|
-
# @pattern_cc_one_one << @_attr_value1 << '")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
|
|
979
931
|
@pattern_cc_one_one = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))(" # rubocop:disable Layout/LineLength
|
|
980
932
|
@pattern_cc_one_two = String.new('') << '.*?<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
981
933
|
@pattern_cc_two = String.new('') << '<\\/' << @_name << '>'
|
|
@@ -1016,11 +968,6 @@ module Meteor
|
|
|
1016
968
|
# document (全体)
|
|
1017
969
|
@elm_.document = @res[0]
|
|
1018
970
|
# pattern (空要素検索用パターン)
|
|
1019
|
-
# @pattern_cc = String.new('') << "<" << @_name << '\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
1020
|
-
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
1021
|
-
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
1022
|
-
# @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
1023
|
-
# @pattern_cc << @_attr_value1 << closer
|
|
1024
971
|
@pattern_cc = "<#{@_name}(\\s[^<>]*(#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}#{closer}" # rubocop:disable Layout/LineLength
|
|
1025
972
|
@elm_.pattern = @pattern_cc
|
|
1026
973
|
@elm_.parser = self
|
|
@@ -1074,11 +1021,6 @@ module Meteor
|
|
|
1074
1021
|
private :quote_element_four
|
|
1075
1022
|
|
|
1076
1023
|
def element_pattern_four
|
|
1077
|
-
# @pattern_cc = String.new('') << '<([^<>"]*)\\s([^<>]*(' << @_attr_name1 << '="'
|
|
1078
|
-
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
1079
|
-
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
1080
|
-
# @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
1081
|
-
# @pattern_cc << @_attr_value1 << '"'
|
|
1082
1024
|
@pattern_cc = "<([^<>\"]*)\\s[^<>]*(#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")" # rubocop:disable Layout/LineLength
|
|
1083
1025
|
end
|
|
1084
1026
|
|
|
@@ -1495,8 +1437,8 @@ module Meteor
|
|
|
1495
1437
|
@pattern = Meteor::Core::Util::PatternCache.get(String.new('') << attr_name << '="[^"]*"')
|
|
1496
1438
|
# @pattern = Meteor::Core::Util::PatternCache.get("#{attr_name}=\"[^\"]*\"")
|
|
1497
1439
|
|
|
1440
|
+
# elm.attributes.sub!(@pattern, "#{attr_name}=\"#{@_attr_value}\"")
|
|
1498
1441
|
elm.attributes.sub!(@pattern, String.new('') << attr_name << '="' << @_attr_value << '"')
|
|
1499
|
-
# elm.attributes.sub!(@pattern, "#{attr_name}=\"#{@_attr_value}\"")
|
|
1500
1442
|
else
|
|
1501
1443
|
# add an attribute to attrubutes (属性文字列の最後に新規の属性を追加する)
|
|
1502
1444
|
|
|
@@ -1828,8 +1770,6 @@ module Meteor
|
|
|
1828
1770
|
@_id = Regexp.quote(id)
|
|
1829
1771
|
|
|
1830
1772
|
# CX tag search pattern (CXタグ検索用パターン)
|
|
1831
|
-
# @pattern_cc = String.new('') << "<!--\\s@" << @_name << '\\s([^<>]*id="'
|
|
1832
|
-
# @pattern_cc << id << '"[^<>]*)-->(((?!(<!--\\s/@' << @_name << ")).)*)<!--\\s/@" << @_name << "\\s-->"
|
|
1833
1773
|
# @pattern_cc = "<!--\\s@#{@_name}\\s([^<>]*id=\"#{@_id}\"[^<>]*)-->(((?!(<!--\\s\\/@#{@_name})).)*)<!--\\s\\/@#{@_name}\\s-->" # rubocop:disable Layout/LineLength
|
|
1834
1774
|
@pattern_cc = "<!--\\s@#{@_name}\\s([^<>]*id=\"#{@_id}\"[^<>]*)-->(((?!(<!--\\s/@#{@_name})).)*)<!--\\s/@#{@_name}\\s-->" # rubocop:disable Layout/LineLength
|
|
1835
1775
|
|
|
@@ -1951,19 +1891,12 @@ module Meteor
|
|
|
1951
1891
|
if element_hook
|
|
1952
1892
|
if element_hook.origin.childless
|
|
1953
1893
|
if element_hook.origin.cx
|
|
1954
|
-
# @root.hookDocument << '<!-- @' << @root.element.name << ' '
|
|
1955
|
-
# @root.hookDocument << @root.element.attributes << '-->'
|
|
1956
|
-
# @root.hookDocument << @root.element.mixed_content << '<!-- /@'
|
|
1957
|
-
# @root.hookDocument << @root.element.name << ' -->'
|
|
1958
1894
|
document_hook <<
|
|
1959
1895
|
"<!-- @#{element_hook.name} #{element_hook.attributes}-->#{element_hook.mixed_content}<!-- /@#{element_hook.name} -->" # rubocop:disable Layout/LineLength
|
|
1960
1896
|
|
|
1961
1897
|
# self.document_hook << @root.newline <<
|
|
1962
1898
|
# "<!-- @#{self.element_hook.name} #{self.element_hook.attributes}-->#{self.element_hook.mixed_content}<!-- /@#{self.element_hook.name} -->" # rubocop:disable Layout/LineLength
|
|
1963
1899
|
else
|
|
1964
|
-
# @root.hookDocument << "<" << @root.element.name
|
|
1965
|
-
# @root.hookDocument << @root.element.attributes << '>' << @root.element.mixed_content
|
|
1966
|
-
# @root.hookDocument << '</' << @root.element.name << '>'
|
|
1967
1900
|
document_hook <<
|
|
1968
1901
|
"<#{element_hook.name}#{element_hook.attributes}>#{element_hook.mixed_content}</#{element_hook.name}>"
|
|
1969
1902
|
|
|
@@ -1976,22 +1909,15 @@ module Meteor
|
|
|
1976
1909
|
@_attributes = element_hook.attributes
|
|
1977
1910
|
|
|
1978
1911
|
if element_hook.origin.cx
|
|
1979
|
-
# @root.hookDocument << '<!-- @' << @root.element.name << ' '
|
|
1980
|
-
# @root.hookDocument << @_attributes << '-->'
|
|
1981
|
-
# @root.hookDocument << @root.document << '<!-- /@'
|
|
1982
|
-
# @root.hookDocument << @root.element.name << ' -->'
|
|
1983
1912
|
document_hook <<
|
|
1984
1913
|
"<!-- @#{element_hook.name} #{@_attributes}-->#{@root.document}<!-- /@#{element_hook.name} -->"
|
|
1985
1914
|
|
|
1986
|
-
# self.document_hook << @root.newline << "<!-- @#{
|
|
1915
|
+
# self.document_hook << @root.newline << "<!-- @#{element_hook.name} #{@_attributes}-->#{@root.document}<!-- /@#{element_hook.name} -->" # rubocop:disable Layout/LineLength
|
|
1987
1916
|
else
|
|
1988
|
-
# @root.hookDocument << "<" << @root.element.name
|
|
1989
|
-
# @root.hookDocument << @_attributes << '>' << @root.document
|
|
1990
|
-
# @root.hookDocument << '</' << @root.element.name << '>'
|
|
1991
1917
|
document_hook <<
|
|
1992
1918
|
"<#{element_hook.name}#{@_attributes}>#{@root.document}</#{element_hook.name}>"
|
|
1993
1919
|
|
|
1994
|
-
#
|
|
1920
|
+
# document_hook << @root.newline << "<#{element_hook.name}#{@_attributes}>#{@root.document}</#{element_hook.name}>" # rubocop:disable Layout/LineLength
|
|
1995
1921
|
end
|
|
1996
1922
|
|
|
1997
1923
|
end
|
data/lib/meteor/element.rb
CHANGED
|
@@ -208,12 +208,8 @@ module Meteor
|
|
|
208
208
|
case @parser.doc_type
|
|
209
209
|
when Parser::HTML, Parser::HTML4
|
|
210
210
|
@document = if @cx
|
|
211
|
-
# @pattern_cc = String.new('') << '<!-- @' << elm.name << ' ' << elm.attributes << '-->'
|
|
212
|
-
# << elm.mixed_content << '<!-- /@' << elm.name << ' -->'
|
|
213
211
|
"<!-- @#{@name} #{@attributes} -->#{@mixed_content}<!-- /@#{@name} -->"
|
|
214
212
|
elsif @normal
|
|
215
|
-
# @pattern_cc = String.new('') << "<" << elm.name << elm.attributes << '>'
|
|
216
|
-
# << elm.mixed_content << '</' << elm.name << '>'
|
|
217
213
|
"<#{@name}#{@attributes}>#{@mixed_content}</#{@name}>"
|
|
218
214
|
else
|
|
219
215
|
String.new('') << '<' << @name << @attributes << '>'
|
|
@@ -221,16 +217,12 @@ module Meteor
|
|
|
221
217
|
end
|
|
222
218
|
when Parser::XHTML, Parser::XHTML4, Parser::XML
|
|
223
219
|
@document = if @cx
|
|
224
|
-
# @pattern_cc = String.new('') << '<!-- @' << elm.name << ' ' << elm.attributes << '-->'
|
|
225
|
-
# << elm.mixed_content << '<!-- /@' << elm.name << ' -->'
|
|
226
220
|
"<!-- @#{@name} #{@attributes} -->#{@mixed_content}<!-- /@#{@name} -->"
|
|
227
221
|
elsif @normal
|
|
228
|
-
# @pattern_cc = String.new('') << "<" << elm.name << elm.attributes << '>' << elm.mixed_content
|
|
229
|
-
# << '</' << elm.name << '>'
|
|
230
222
|
"<#{@name}#{@attributes}>#{@mixed_content}</#{@name}>"
|
|
231
223
|
else
|
|
232
224
|
String.new('') << '<' << @name << @attributes << '/>'
|
|
233
|
-
#
|
|
225
|
+
# "<#{@name}#{@attributes}/>"
|
|
234
226
|
end
|
|
235
227
|
end
|
|
236
228
|
else
|
|
@@ -203,8 +203,6 @@ module Meteor
|
|
|
203
203
|
end
|
|
204
204
|
else
|
|
205
205
|
# normal element search pattern (内容あり要素検索用パターン()
|
|
206
|
-
# @pattern_cc = String.new('') << "<" << @_name << '(|\\s[^<>]*)>(((?!(' << @_name
|
|
207
|
-
# @pattern_cc << '[^<>]*>)).)*)<\\/' << @_name << '>'
|
|
208
206
|
@pattern_cc = "<#{@_name}(|\\s[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
|
|
209
207
|
|
|
210
208
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
@@ -258,8 +256,6 @@ module Meteor
|
|
|
258
256
|
# case of void element (空要素の場合(<->内容あり要素の場合))
|
|
259
257
|
if match?(MATCH_TAG, name)
|
|
260
258
|
# void element search pattern (空要素検索パターン)
|
|
261
|
-
# @pattern_cc = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
|
|
262
|
-
# @pattern_cc << @_attr_value << '"[^<>]*)>'
|
|
263
259
|
@pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*)>"
|
|
264
260
|
|
|
265
261
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
@@ -274,9 +270,6 @@ module Meteor
|
|
|
274
270
|
end
|
|
275
271
|
else
|
|
276
272
|
# normal element search pattern (内容あり要素検索パターン)
|
|
277
|
-
# @pattern_cc = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
|
|
278
|
-
# @pattern_cc << @_attr_value << '"[^<>]*)>(((?!(' << @_name
|
|
279
|
-
# @pattern_cc << '[^<>]*>)).)*)<\\/' << @_name << '>'
|
|
280
273
|
@pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>" # rubocop:disable Layout/LineLength
|
|
281
274
|
|
|
282
275
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
@@ -314,8 +307,6 @@ module Meteor
|
|
|
314
307
|
def element_two(attr_name, attr_value) # rubocop:disable Metrics/MethodLength
|
|
315
308
|
quote_attribute(attr_name, attr_value)
|
|
316
309
|
|
|
317
|
-
# @pattern_cc = String.new('') << '<([^<>"]*)\\s[^<>]*' << @_attr_name << '="' << @_attr_value
|
|
318
|
-
# @pattern_cc << '"[^<>]*>'
|
|
319
310
|
@pattern_cc = "<([^<>\"]*)\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*>"
|
|
320
311
|
|
|
321
312
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
@@ -349,11 +340,6 @@ module Meteor
|
|
|
349
340
|
# case of void element (空要素の場合(<->内容あり要素の場合))
|
|
350
341
|
if match?(MATCH_TAG, name)
|
|
351
342
|
# void element search pattern (空要素検索パターン)
|
|
352
|
-
# @pattern_cc = String.new('') << "<" << @_name << '(\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
353
|
-
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
354
|
-
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
355
|
-
# @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
356
|
-
# @pattern_cc << @_attr_value1 << '")[^<>]*)>'
|
|
357
343
|
@pattern_cc = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>" # rubocop:disable Layout/LineLength
|
|
358
344
|
|
|
359
345
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
@@ -375,12 +361,6 @@ module Meteor
|
|
|
375
361
|
end
|
|
376
362
|
else
|
|
377
363
|
# normal element search pattern (内容あり要素検索パターン)
|
|
378
|
-
# @pattern_cc = String.new('') << "<" << @_name << '(\\s[^<>]*(?:' << @_attr_name1 << '="'
|
|
379
|
-
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
380
|
-
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
381
|
-
# @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
|
|
382
|
-
# @pattern_cc << @_attr_value1 << '")[^<>]*)>(((?!(' << @_name
|
|
383
|
-
# @pattern_cc << '[^<>]*>)).)*)<\\/' << @_name << '>'
|
|
384
364
|
@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
|
|
385
365
|
|
|
386
366
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
@@ -427,11 +407,6 @@ module Meteor
|
|
|
427
407
|
def element_four(attr_name1, attr_value1, attr_name2, attr_value2) # rubocop:disable Metrics/MethodLength
|
|
428
408
|
quote_element_four(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
429
409
|
|
|
430
|
-
# @pattern_cc = String.new('') << '<([^<>"]*)\\s([^<>]*(' << @_attr_name1 << '="' << @_attr_value1
|
|
431
|
-
# @pattern_cc << '"[^<>]*' << @_attr_name2 << '="' << @_attr_value2
|
|
432
|
-
# @pattern_cc << '"|' << @_attr_name2 << '="' << @_attr_value2
|
|
433
|
-
# @pattern_cc << '"[^<>]*' << @_attr_name1 << '="' << @_attr_value1
|
|
434
|
-
# @pattern_cc << '")[^<>]*)>'
|
|
435
410
|
@pattern_cc = "<([^<>\"]*)\\s([^<>]*(#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>" # rubocop:disable Layout/LineLength
|
|
436
411
|
|
|
437
412
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
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.41
|
|
41
41
|
#
|
|
42
42
|
|
|
43
43
|
module Meteor
|
|
44
|
-
VERSION = '0.9.
|
|
44
|
+
VERSION = '0.9.41'
|
|
45
45
|
|
|
46
46
|
# require 'fileutils'
|
|
47
47
|
|
data/meteor.gemspec
CHANGED
|
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features|demo)/})
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_development_dependency 'bundler', '~> 4.0.
|
|
25
|
+
spec.add_development_dependency 'bundler', '~> 4.0.16'
|
|
26
26
|
# spec.add_development_dependency "rake"
|
|
27
27
|
end
|
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.
|
|
4
|
+
version: 0.9.41
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yasumasa Ashida
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 4.0.
|
|
18
|
+
version: 4.0.16
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 4.0.
|
|
25
|
+
version: 4.0.16
|
|
26
26
|
description: A lightweight (X)HTML & XML parser
|
|
27
27
|
email: ys.ashida@gmail.com
|
|
28
28
|
executables: []
|
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
83
|
version: '0'
|
|
84
84
|
requirements: []
|
|
85
|
-
rubygems_version: 4.0.
|
|
85
|
+
rubygems_version: 4.0.16
|
|
86
86
|
specification_version: 4
|
|
87
87
|
summary: A lightweight (X)HTML & XML parser
|
|
88
88
|
test_files:
|