meteor 0.9.14 → 0.9.15
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 +1 -1
- data/lib/meteor/core/kernel.rb +25 -16
- data/lib/meteor/ml/html/parser_impl.rb +2 -2
- data/lib/meteor/ml/html4/parser_impl.rb +9 -6
- data/lib/meteor/ml/xml/parser_impl.rb +1 -1
- 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: d6586cbfb631f019d21e7c7b9e900452d2611b9afefcf0ac38bd9e7f004224f6
|
|
4
|
+
data.tar.gz: 6a8872a716c23859f82070db908b1097cd8d0424b9ad5d8ce989896680eaf5e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 660d690f2e3e458da8f945ce9fbe35e23f095c3144be4364a4cbcaae41f67e8a6e37f7ee81c2b9429349f945fc15d4b968d53c83f9418ea9518d17db8974a30b
|
|
7
|
+
data.tar.gz: a39d22634dae13029428b91b10ff66016f3945b3ba37d3d484d11897bf43ad86c3c2e7fc4f0993c258a747a0b8475e170aadcabf655d98b482e3692825deb8c5
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/lib/meteor/core/kernel.rb
CHANGED
|
@@ -369,7 +369,11 @@ module Meteor
|
|
|
369
369
|
# @param [true,false] quote flag (クオート・フラグ)
|
|
370
370
|
# @return [Meteor::Element] element (要素)
|
|
371
371
|
def element_3(name, attr_name, attr_value, quote = true)
|
|
372
|
-
|
|
372
|
+
if quote
|
|
373
|
+
quote_element_3(name, attr_name, attr_value)
|
|
374
|
+
else
|
|
375
|
+
quote_name(name)
|
|
376
|
+
end
|
|
373
377
|
|
|
374
378
|
@pattern_cc_1 = element_pattern_3
|
|
375
379
|
|
|
@@ -429,13 +433,12 @@ module Meteor
|
|
|
429
433
|
|
|
430
434
|
private :element_pattern_3
|
|
431
435
|
|
|
432
|
-
def
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
@_attr_value = Regexp.quote(attr_value)
|
|
436
|
+
def quote_element_3(name, attr_name, attr_value)
|
|
437
|
+
quote_name(name)
|
|
438
|
+
quote_attribute(attr_name, attr_value)
|
|
436
439
|
end
|
|
437
440
|
|
|
438
|
-
private :
|
|
441
|
+
private :quote_element_3
|
|
439
442
|
|
|
440
443
|
def element_with_3_1(name)
|
|
441
444
|
# puts @res.captures.length
|
|
@@ -594,7 +597,7 @@ module Meteor
|
|
|
594
597
|
#
|
|
595
598
|
def element_2(attr_name, attr_value)
|
|
596
599
|
|
|
597
|
-
|
|
600
|
+
quote_attribute(attr_name, attr_value)
|
|
598
601
|
|
|
599
602
|
element_pattern_2
|
|
600
603
|
|
|
@@ -665,12 +668,18 @@ module Meteor
|
|
|
665
668
|
|
|
666
669
|
private :element_2
|
|
667
670
|
|
|
668
|
-
def
|
|
671
|
+
def quote_name(name)
|
|
672
|
+
@_name = Regexp.quote(name)
|
|
673
|
+
end
|
|
674
|
+
|
|
675
|
+
private :quote_name
|
|
676
|
+
|
|
677
|
+
def quote_attribute(attr_name, attr_value)
|
|
669
678
|
@_attr_name = Regexp.quote(attr_name)
|
|
670
679
|
@_attr_value = Regexp.quote(attr_value)
|
|
671
680
|
end
|
|
672
681
|
|
|
673
|
-
private :
|
|
682
|
+
private :quote_attribute
|
|
674
683
|
|
|
675
684
|
def element_pattern_2
|
|
676
685
|
# # @pattern_cc = String.new('') << '<([^<>"]*)\\s[^<>]*' << @_attr_name << '="' << @_attr_value << '(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
|
|
@@ -681,7 +690,7 @@ module Meteor
|
|
|
681
690
|
private :element_pattern_2
|
|
682
691
|
|
|
683
692
|
=begin
|
|
684
|
-
|
|
693
|
+
def element_with_2_1
|
|
685
694
|
# puts @res.captures.length
|
|
686
695
|
case @res.captures.length
|
|
687
696
|
when FOUR
|
|
@@ -820,7 +829,7 @@ module Meteor
|
|
|
820
829
|
#
|
|
821
830
|
def element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
822
831
|
|
|
823
|
-
|
|
832
|
+
quote_element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
824
833
|
|
|
825
834
|
@pattern_cc_1 = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)\\/>|<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
|
|
826
835
|
|
|
@@ -874,7 +883,7 @@ module Meteor
|
|
|
874
883
|
|
|
875
884
|
private :element_5
|
|
876
885
|
|
|
877
|
-
def
|
|
886
|
+
def quote_element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
878
887
|
@_name = Regexp.quote(name)
|
|
879
888
|
@_attr_name1 = Regexp.quote(attr_name1)
|
|
880
889
|
@_attr_name2 = Regexp.quote(attr_name2)
|
|
@@ -882,7 +891,7 @@ module Meteor
|
|
|
882
891
|
@_attr_value2 = Regexp.quote(attr_value2)
|
|
883
892
|
end
|
|
884
893
|
|
|
885
|
-
private :
|
|
894
|
+
private :quote_element_5
|
|
886
895
|
|
|
887
896
|
def element_with_5_1(name)
|
|
888
897
|
|
|
@@ -1048,7 +1057,7 @@ module Meteor
|
|
|
1048
1057
|
#
|
|
1049
1058
|
def element_4(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
1050
1059
|
|
|
1051
|
-
|
|
1060
|
+
quote_element_4(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
1052
1061
|
|
|
1053
1062
|
element_pattern_4
|
|
1054
1063
|
|
|
@@ -1073,14 +1082,14 @@ module Meteor
|
|
|
1073
1082
|
|
|
1074
1083
|
private :element_4
|
|
1075
1084
|
|
|
1076
|
-
def
|
|
1085
|
+
def quote_element_4(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
1077
1086
|
@_attr_name1 = Regexp.quote(attr_name1)
|
|
1078
1087
|
@_attr_name2 = Regexp.quote(attr_name2)
|
|
1079
1088
|
@_attr_value1 = Regexp.quote(attr_value1)
|
|
1080
1089
|
@_attr_value2 = Regexp.quote(attr_value2)
|
|
1081
1090
|
end
|
|
1082
1091
|
|
|
1083
|
-
private :
|
|
1092
|
+
private :quote_element_4
|
|
1084
1093
|
|
|
1085
1094
|
def element_pattern_4
|
|
1086
1095
|
|
|
@@ -12,7 +12,7 @@ module Meteor
|
|
|
12
12
|
MATCH_TAG = ["br", "hr", "img", "input", "meta", "base", "embed", "command", "keygen"]
|
|
13
13
|
|
|
14
14
|
#[Array] non-nestable elements (入れ子にできない要素)
|
|
15
|
-
|
|
15
|
+
MATCH_TAG_NNE = [
|
|
16
16
|
"texarea",
|
|
17
17
|
"select",
|
|
18
18
|
"option",
|
|
@@ -57,7 +57,7 @@ module Meteor
|
|
|
57
57
|
def initialize(*args)
|
|
58
58
|
super()
|
|
59
59
|
@@match_tag = MATCH_TAG
|
|
60
|
-
@@
|
|
60
|
+
@@MATCH_TAG_NNE = MATCH_TAG_NNE
|
|
61
61
|
@@attr_logic = ATTR_LOGIC
|
|
62
62
|
@doc_type = Parser::HTML
|
|
63
63
|
case args.length
|
|
@@ -214,7 +214,7 @@ module Meteor
|
|
|
214
214
|
# @return [Meteor::Element] element (要素)
|
|
215
215
|
#
|
|
216
216
|
def element_1(name)
|
|
217
|
-
|
|
217
|
+
quote_name(name)
|
|
218
218
|
|
|
219
219
|
# case of void element (空要素の場合(<->内容あり要素の場合))
|
|
220
220
|
if is_match(@@match_tag, name)
|
|
@@ -281,8 +281,11 @@ module Meteor
|
|
|
281
281
|
# @return [Meteor::Element] element (要素)
|
|
282
282
|
#
|
|
283
283
|
def element_3(name, attr_name, attr_value, quote = true)
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
if quote
|
|
285
|
+
quote_element_3(name, attr_name, attr_value)
|
|
286
|
+
else
|
|
287
|
+
quote_name(name)
|
|
288
|
+
end
|
|
286
289
|
|
|
287
290
|
# case of void element (空要素の場合(<->内容あり要素の場合))
|
|
288
291
|
if is_match(@@match_tag, name)
|
|
@@ -348,7 +351,7 @@ module Meteor
|
|
|
348
351
|
#
|
|
349
352
|
def element_2(attr_name, attr_value)
|
|
350
353
|
|
|
351
|
-
|
|
354
|
+
quote_attribute(attr_name, attr_value)
|
|
352
355
|
|
|
353
356
|
# @pattern_cc = String.new('') << '<([^<>"]*)\\s[^<>]*' << @_attr_name << '="' << @_attr_value
|
|
354
357
|
# @pattern_cc << '"[^<>]*>'
|
|
@@ -383,7 +386,7 @@ module Meteor
|
|
|
383
386
|
#
|
|
384
387
|
def element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
385
388
|
|
|
386
|
-
|
|
389
|
+
quote_element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
387
390
|
|
|
388
391
|
# 空要素の場合(<->内容あり要素の場合)
|
|
389
392
|
if is_match(@@match_tag, name)
|
|
@@ -466,7 +469,7 @@ module Meteor
|
|
|
466
469
|
# @return [Meteor::Element] element (要素)
|
|
467
470
|
#
|
|
468
471
|
def element_4(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
469
|
-
|
|
472
|
+
quote_element_4(attr_name1, attr_value1, attr_name2, attr_value2)
|
|
470
473
|
|
|
471
474
|
# @pattern_cc = String.new('') << '<([^<>"]*)\\s([^<>]*(' << @_attr_name1 << '="' << @_attr_value1
|
|
472
475
|
# @pattern_cc << '"[^<>]*' << @_attr_name2 << '="' << @_attr_value2
|
data/lib/meteor.rb
CHANGED
|
@@ -36,11 +36,11 @@ require "meteor/ml/xml/parser_impl"
|
|
|
36
36
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
37
37
|
#
|
|
38
38
|
# @author Yasumasa Ashida
|
|
39
|
-
# @version 0.9.
|
|
39
|
+
# @version 0.9.15
|
|
40
40
|
#
|
|
41
41
|
|
|
42
42
|
module Meteor
|
|
43
|
-
VERSION = "0.9.
|
|
43
|
+
VERSION = "0.9.15"
|
|
44
44
|
|
|
45
45
|
# require 'fileutils'
|
|
46
46
|
|