meteor 0.9.13 → 0.9.14

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.
@@ -17,23 +17,23 @@ module Meteor
17
17
  class Kernel < Meteor::Parser
18
18
  # find
19
19
  # E
20
- PATTERN_FIND_1 = '^([^,\\[\\]#\\.]+)$'
20
+ PATTERN_FIND_1 = "^([^,\\[\\]#\\.]+)$"
21
21
  # # id_attribute_value
22
- PATTERN_FIND_2_1 = '^#([^\\.,\\[\\]#][^,\\[\\]#]*)$'
22
+ PATTERN_FIND_2_1 = "^#([^\\.,\\[\\]#][^,\\[\\]#]*)$"
23
23
  # .class_attribute_value
24
- PATTERN_FIND_2_2 = '^\\.([^\\.,\\[\\]#][^,\\[\\]#]*)$'
24
+ PATTERN_FIND_2_2 = "^\\.([^\\.,\\[\\]#][^,\\[\\]#]*)$"
25
25
  # [attribute_name=attribute_value]
26
- PATTERN_FIND_2_3 = '^\\[([^\\[\\],]+)=([^\\[\\],]+)\\]$'
26
+ PATTERN_FIND_2_3 = "^\\[([^\\[\\],]+)=([^\\[\\],]+)\\]$"
27
27
  # E[attribute_name=attribute_value]
28
- PATTERN_FIND_3_1 = '^([^\\.,\\[\\]#][^,\\[\\]#]+)\\[([^,\\[\\]]+)=([^,\\[\\]]+)\\]$'
28
+ PATTERN_FIND_3_1 = "^([^\\.,\\[\\]#][^,\\[\\]#]+)\\[([^,\\[\\]]+)=([^,\\[\\]]+)\\]$"
29
29
  # E# id_attribute_value
30
- PATTERN_FIND_3_2 = '^([^\\.,\\[\\]#][^,\\[\\]#]+)#([^\\.,\\[\\]#][^,\\[\\]#]*)$'
30
+ PATTERN_FIND_3_2 = "^([^\\.,\\[\\]#][^,\\[\\]#]+)#([^\\.,\\[\\]#][^,\\[\\]#]*)$"
31
31
  # E.class_attribute_value
32
- PATTERN_FIND_3_3 = '^([^\\.,\\[\\]#][^,\\[\\]#]+)\\.([^\\.,\\[\\]#][^,\\[\\]#]*)$'
32
+ PATTERN_FIND_3_3 = "^([^\\.,\\[\\]#][^,\\[\\]#]+)\\.([^\\.,\\[\\]#][^,\\[\\]#]*)$"
33
33
  # [attribute_name1=attribute_value1][attribute_name2=attribute_value2]
34
- PATTERN_FIND_4 = '^\\[([^,]+)=([^,]+)\\]\\[([^,]+)=([^,]+)\\]$'
34
+ PATTERN_FIND_4 = "^\\[([^,]+)=([^,]+)\\]\\[([^,]+)=([^,]+)\\]$"
35
35
  # E[attribute_name1=attribute_value1][attribute_name2=attribute_value2]
36
- PATTERN_FIND_5 = '^([^\\.,\\[\\]#][^,\\[\\]#]+)\\[([^,]+)=([^,]+)\\]\\[([^,]+)=([^,]+)\\]$'
36
+ PATTERN_FIND_5 = "^([^\\.,\\[\\]#][^,\\[\\]#]+)\\[([^,]+)=([^,]+)\\]\\[([^,]+)=([^,]+)\\]$"
37
37
 
38
38
  @@pattern_find_1 = Regexp.new(PATTERN_FIND_1)
39
39
  @@pattern_find_2_1 = Regexp.new(PATTERN_FIND_2_1)
@@ -45,12 +45,12 @@ module Meteor
45
45
  @@pattern_find_4 = Regexp.new(PATTERN_FIND_4)
46
46
  @@pattern_find_5 = Regexp.new(PATTERN_FIND_5)
47
47
 
48
- @@pattern_set_mono1 = Regexp.new('\\A[^<>]*\\Z')
48
+ @@pattern_set_mono1 = Regexp.new("\\A[^<>]*\\Z")
49
49
 
50
- @@pattern_get_attrs_map = Regexp.new('([^\\s]*)="([^\"]*)"')
50
+ @@pattern_get_attrs_map = Regexp.new("([^\\s]*)=\"([^\\\"]*)\"")
51
51
 
52
- @@pattern_clean1 = Regexp.new('<!--\\s@[^<>]*\\s[^<>]*(\\s)*-->')
53
- @@pattern_clean2 = Regexp.new('<!--\\s\\/@[^<>]*(\\s)*-->')
52
+ @@pattern_clean1 = Regexp.new("<!--\\s@[^<>]*\\s[^<>]*(\\s)*-->")
53
+ @@pattern_clean2 = Regexp.new("<!--\\s\\/@[^<>]*(\\s)*-->")
54
54
 
55
55
  attr_accessor :element_cache
56
56
  attr_accessor :doc_type
@@ -113,7 +113,7 @@ module Meteor
113
113
  # element cache (要素キャッシュ)
114
114
  @element_cache = Hash.new
115
115
  # document hook (フック・ドキュメント)
116
- @document_hook = String.new('')
116
+ @document_hook = String.new("")
117
117
 
118
118
  @error_check = true
119
119
  end
@@ -132,7 +132,7 @@ module Meteor
132
132
  # io = File.open(file_path,"r:" << enc)
133
133
  io = File.open(file_path, "r:UTF-8")
134
134
  else
135
- io = File.open(file_path, String.new('') << "r:" << enc << ":utf-8")
135
+ io = File.open(file_path, String.new("") << "r:" << enc << ":utf-8")
136
136
  end
137
137
 
138
138
  # load and save (読込及び格納)
@@ -199,7 +199,7 @@ module Meteor
199
199
  # @param [Meteor::Element] elm element (要素)
200
200
  # @return [Meteor::Element] element (要素)
201
201
  #
202
- def element(elm, attrs = nil,*args)
202
+ def element(elm, attrs = nil, *args)
203
203
  if !attrs
204
204
  if elm.kind_of?(String) || elm.kind_of?(Symbol)
205
205
  element_1(elm.to_s)
@@ -242,29 +242,32 @@ module Meteor
242
242
  end
243
243
  elsif attrs.kind_of?(String) || attrs.kind_of?(Symbol)
244
244
  case args.length
245
- when ZERO
246
- element_2(elm.to_s,attrs.to_s)
247
- if @elm_
248
- @element_cache.store(@elm_.object_id, @elm_)
249
- end
250
- when ONE
251
- element_3(elm.to_s, attrs.to_s, args[0])
252
- if @elm_
253
- @element_cache.store(@elm_.object_id, @elm_)
254
- end
255
- when TWO
256
- element_4(elm.to_s, attrs.to_s, args[0].to_s,args[1])
257
- if @elm_
258
- @element_cache.store(@elm_.object_id, @elm_)
259
- end
260
- when THREE
261
- element_5(elm.to_s, attrs.to_s, args[0],args[1].to_s,args[2])
262
- if @elm_
263
- @element_cache.store(@elm_.object_id, @elm_)
264
- end
265
- else
266
- @elm_ = nil
267
- raise ArgumentError
245
+ when ZERO
246
+ element_2(elm.to_s, attrs.to_s)
247
+ if @elm_
248
+ @element_cache.store(@elm_.object_id, @elm_)
249
+ end
250
+
251
+ when ONE
252
+ element_3(elm.to_s, attrs.to_s, args[0])
253
+ if @elm_
254
+ @element_cache.store(@elm_.object_id, @elm_)
255
+ end
256
+
257
+ when TWO
258
+ element_4(elm.to_s, attrs.to_s, args[0].to_s, args[1])
259
+ if @elm_
260
+ @element_cache.store(@elm_.object_id, @elm_)
261
+ end
262
+
263
+ when THREE
264
+ element_5(elm.to_s, attrs.to_s, args[0], args[1].to_s, args[2])
265
+ if @elm_
266
+ @element_cache.store(@elm_.object_id, @elm_)
267
+ end
268
+ else
269
+ @elm_ = nil
270
+ raise ArgumentError
268
271
  end
269
272
  else
270
273
  @elm_ = nil
@@ -294,7 +297,7 @@ module Meteor
294
297
  # puts '---element_with_1'
295
298
  element_with_1(name)
296
299
  end
297
- # else
300
+ # else
298
301
  end
299
302
 
300
303
  @elm_
@@ -345,7 +348,7 @@ module Meteor
345
348
  # document (全体)
346
349
  @elm_.document = @res[0]
347
350
  # void element search pattern (空要素検索用パターン)
348
- @pattern_cc = String.new('') << "<" << @_name << '(|\\s[^<>]*)\\/>'
351
+ @pattern_cc = String.new("") << "<" << @_name << "(|\\s[^<>]*)\\/>"
349
352
  # @pattern_cc = "<#{@_name}(|\\s[^<>]*)\\/>"
350
353
  @elm_.pattern = @pattern_cc
351
354
 
@@ -366,7 +369,7 @@ module Meteor
366
369
  # @param [true,false] quote flag (クオート・フラグ)
367
370
  # @return [Meteor::Element] element (要素)
368
371
  def element_3(name, attr_name, attr_value, quote = true)
369
- element_quote_3(name,attr_name,attr_value)
372
+ element_quote_3(name, attr_name, attr_value)
370
373
 
371
374
  @pattern_cc_1 = element_pattern_3
372
375
 
@@ -409,8 +412,9 @@ module Meteor
409
412
  element_with_3_1(name)
410
413
  else
411
414
  if @error_check
412
- puts Meteor::Exception::NoSuchElementException.new(name, attr_name, attr_value).message
415
+ puts(Meteor::Exception::NoSuchElementException.new(name, attr_name, attr_value).message)
413
416
  end
417
+
414
418
  @elm_ = nil
415
419
  end
416
420
 
@@ -425,7 +429,7 @@ module Meteor
425
429
 
426
430
  private :element_pattern_3
427
431
 
428
- def element_quote_3(name,attr_name,attr_value)
432
+ def element_quote_3(name, attr_name, attr_value)
429
433
  @_name = Regexp.quote(name)
430
434
  @_attr_name = Regexp.quote(attr_name)
431
435
  @_attr_value = Regexp.quote(attr_value)
@@ -478,7 +482,7 @@ module Meteor
478
482
 
479
483
  @elm_.parser = self
480
484
 
481
- when THREE,SIX
485
+ when THREE, SIX
482
486
  # element (要素)
483
487
  @elm_ = Meteor::Element.new(name)
484
488
  unless @on_search
@@ -501,6 +505,7 @@ module Meteor
501
505
 
502
506
  @elm_.parser = self
503
507
  end
508
+
504
509
  @elm_
505
510
  end
506
511
 
@@ -525,26 +530,25 @@ module Meteor
525
530
  # @pattern_cc_1 = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
526
531
  # @pattern_cc_1 << @_attr_value << '(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))'
527
532
  @pattern_cc_1 = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))"
528
- @pattern_cc_1b = String.new('') << "<" << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
533
+ @pattern_cc_1b = String.new("") << "<" << @_name << "(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
529
534
  # @pattern_cc_1b = "<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
530
535
  # @pattern_cc_1_1 = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="'
531
536
  # @pattern_cc_1_1 << @_attr_value << '"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
532
537
  @pattern_cc_1_1 = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
533
- @pattern_cc_1_2 = String.new('') << '.*?<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
538
+ @pattern_cc_1_2 = String.new("") << ".*?<" << @_name << "(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
534
539
  # @pattern_cc_1_2 = ".*?<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
535
540
 
536
-
537
- @pattern_cc_2 = String.new('') << '<\\/' << @_name << '>'
541
+ @pattern_cc_2 = String.new("") << "<\\/" << @_name << ">"
538
542
  # @pattern_cc_2 = String.new('') << "<\\/#{@_name}>"
539
- @pattern_cc_2_1 = String.new('') << '.*?<\/' << @_name << '>'
543
+ @pattern_cc_2_1 = String.new("") << ".*?<\\/" << @_name << ">"
540
544
  # @pattern_cc_2_1 = ".*?<\\/#{@_name}>"
541
- @pattern_cc_2_2 = String.new('') << '.*?)<\/' << @_name << '>'
545
+ @pattern_cc_2_2 = String.new("") << ".*?)<\\/" << @_name << ">"
542
546
  # @pattern_cc_2_2 = ".*?)<\\/#{@_name}>"
543
547
 
544
548
  # search of element with content (内容あり要素検索)
545
549
  @pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_1)
546
550
 
547
- @sbuf = String.new('')
551
+ @sbuf = String.new("")
548
552
 
549
553
  @pattern_2 = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
550
554
  @pattern_1b = Meteor::Core::Util::PatternCache.get(@pattern_cc_1b)
@@ -554,13 +558,12 @@ module Meteor
554
558
  create_element_pattern
555
559
 
556
560
  @pattern_cc = @sbuf
557
-
558
561
  end
559
562
 
560
563
  private :element_pattern_with_3_2
561
564
 
562
565
  def element_without_3(name)
563
- element_without_3_1(name, '"[^<>]*)\\/>')
566
+ element_without_3_1(name, "\"[^<>]*)\\/>")
564
567
  end
565
568
 
566
569
  private :element_without_3
@@ -573,7 +576,7 @@ module Meteor
573
576
  # document (全体)
574
577
  @elm_.document = @res[0]
575
578
  # pattern (空要素検索用パターン)
576
- @pattern_cc = String.new('') << "<" << @_name << '(\\s[^<>]*' << @_attr_name << '="' << @_attr_value << closer
579
+ @pattern_cc = String.new("") << "<" << @_name << "(\\s[^<>]*" << @_attr_name << "=\"" << @_attr_value << closer
577
580
  # @pattern_cc = "<#{@_name}\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}#{closer}"
578
581
  @elm_.pattern = @pattern_cc
579
582
  @elm_.parser = self
@@ -591,7 +594,7 @@ module Meteor
591
594
  #
592
595
  def element_2(attr_name, attr_value)
593
596
 
594
- element_quote_2(attr_name,attr_value)
597
+ element_quote_2(attr_name, attr_value)
595
598
 
596
599
  element_pattern_2
597
600
 
@@ -602,11 +605,12 @@ module Meteor
602
605
  element_3(@res[1], attr_name, attr_value)
603
606
  else
604
607
  if @error_check
605
- puts Meteor::Exception::NoSuchElementException.new(attr_name, attr_value).message
608
+ puts(Meteor::Exception::NoSuchElementException.new(attr_name, attr_value).message)
606
609
  end
610
+
607
611
  @elm_ = nil
608
612
  end
609
- #=end
613
+ #=end
610
614
 
611
615
  =begin
612
616
  @pattern_cc_1 = "<([^<>\"]*)(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*)\\/>|<([^<>\"]*)(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}\"[^<>]*)>(((?!(\\3[^<>]*>)).)*)<\\/\\3>"
@@ -859,8 +863,9 @@ module Meteor
859
863
  element_with_5_1(name)
860
864
  else
861
865
  if @error_check
862
- puts Meteor::Exception::NoSuchElementException.new(name, attr_name, attr_value).message
866
+ puts(Meteor::Exception::NoSuchElementException.new(name, attr_name, attr_value).message)
863
867
  end
868
+
864
869
  @elm_ = nil
865
870
  end
866
871
 
@@ -926,7 +931,7 @@ module Meteor
926
931
  @elm_.empty = true
927
932
  @elm_.parser = self
928
933
 
929
- when THREE,SIX
934
+ when THREE, SIX
930
935
  # element (要素)
931
936
  @elm_ = Meteor::Element.new(name)
932
937
  # attribute (属性)
@@ -941,6 +946,7 @@ module Meteor
941
946
  @elm_.empty = true
942
947
  @elm_.parser = self
943
948
  end
949
+
944
950
  @elm_
945
951
  end
946
952
 
@@ -970,7 +976,7 @@ module Meteor
970
976
  # @pattern_cc_1 << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
971
977
  # @pattern_cc_1 << @_attr_value1 << '")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))'
972
978
  @pattern_cc_1 = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))"
973
- @pattern_cc_1b = String.new('') << "<" << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
979
+ @pattern_cc_1b = String.new("") << "<" << @_name << "(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
974
980
  # @pattern_cc_1b = "<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
975
981
 
976
982
  # @pattern_cc_1_1 = String.new('') << "<" << @_name << '(\\s[^<>]*(?:' << @_attr_name1 << '="'
@@ -979,10 +985,10 @@ module Meteor
979
985
  # @pattern_cc_1_1 << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
980
986
  # @pattern_cc_1_1 << @_attr_value1 << '")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
981
987
  @pattern_cc_1_1 = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
982
- @pattern_cc_1_2 = String.new('') << '.*?<' << @_name << '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
983
- @pattern_cc_2 = String.new('') << '<\\/' << @_name << '>'
984
- @pattern_cc_2_1 = String.new('') << '.*?<\/' << @_name << '>'
985
- @pattern_cc_2_2 = String.new('') << '.*?)<\/' << @_name << '>'
988
+ @pattern_cc_1_2 = String.new("") << ".*?<" << @_name << "(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
989
+ @pattern_cc_2 = String.new("") << "<\\/" << @_name << ">"
990
+ @pattern_cc_2_1 = String.new("") << ".*?<\\/" << @_name << ">"
991
+ @pattern_cc_2_2 = String.new("") << ".*?)<\\/" << @_name << ">"
986
992
 
987
993
  # @pattern_cc_1_2 = ".*?<#{@_name}(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
988
994
  # @pattern_cc_2 = String.new('') << "<\\/#{@_name}>"
@@ -992,7 +998,7 @@ module Meteor
992
998
  # search of element with content (内容あり要素検索)
993
999
  @pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc_1)
994
1000
 
995
- @sbuf = String.new('')
1001
+ @sbuf = String.new("")
996
1002
 
997
1003
  @pattern_2 = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
998
1004
  @pattern_1b = Meteor::Core::Util::PatternCache.get(@pattern_cc_1b)
@@ -1005,7 +1011,7 @@ module Meteor
1005
1011
  private :element_pattern_with_5_2
1006
1012
 
1007
1013
  def element_without_5(name)
1008
- element_without_5_1(name, '")[^<>]*)\\/>')
1014
+ element_without_5_1(name, "\")[^<>]*)\\/>")
1009
1015
  end
1010
1016
 
1011
1017
  private :element_without_5
@@ -1054,8 +1060,11 @@ module Meteor
1054
1060
  element_5(@res[1], attr_name1, attr_value1, attr_name2, attr_value2)
1055
1061
  else
1056
1062
  if @error_check
1057
- puts Meteor::Exception::NoSuchElementException.new(attr_name1, attr_value1, attr_name2, attr_value2).message
1063
+ puts(
1064
+ Meteor::Exception::NoSuchElementException.new(attr_name1, attr_value1, attr_name2, attr_value2).message
1065
+ )
1058
1066
  end
1067
+
1059
1068
  @elm_ = nil
1060
1069
  end
1061
1070
 
@@ -1081,7 +1090,6 @@ module Meteor
1081
1090
  # @pattern_cc << @_attr_value2 << '"[^<>]*' << @_attr_name1 << '="'
1082
1091
  # @pattern_cc << @_attr_value1 << '"'
1083
1092
  @pattern_cc = "<([^<>\"]*)\\s[^<>]*(#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")"
1084
-
1085
1093
  end
1086
1094
 
1087
1095
  private :element_pattern_4
@@ -1268,7 +1276,7 @@ module Meteor
1268
1276
  # @param [String] attr_value2 attribute value2 (属性値2)
1269
1277
  # @return [Array<Meteor::Element>] element array (要素配列)
1270
1278
  #
1271
- def elements(elm, attrs = nil,*args)
1279
+ def elements(elm, attrs = nil, *args)
1272
1280
  if !attrs
1273
1281
  if elm.kind_of?(String)
1274
1282
  elements_(elm)
@@ -1294,17 +1302,17 @@ module Meteor
1294
1302
  end
1295
1303
  elsif attrs.kind_of?(String)
1296
1304
  case args.length
1297
- when ZERO
1298
- elements_(elm,attrs)
1299
- when ONE
1300
- elements_(elm, attrs, args[0])
1301
- when TWO
1302
- elements_(elm, attrs, args[0],args[1])
1303
- when THREE
1304
- elements_(elm, attrs, args[0],args[1],args[2])
1305
- else
1306
- @elm_ = nil
1307
- raise ArgumentError
1305
+ when ZERO
1306
+ elements_(elm, attrs)
1307
+ when ONE
1308
+ elements_(elm, attrs, args[0])
1309
+ when TWO
1310
+ elements_(elm, attrs, args[0], args[1])
1311
+ when THREE
1312
+ elements_(elm, attrs, args[0], args[1], args[2])
1313
+ else
1314
+ @elm_ = nil
1315
+ raise ArgumentError
1308
1316
  end
1309
1317
  else
1310
1318
  @elm_ = nil
@@ -1318,16 +1326,16 @@ module Meteor
1318
1326
  @on_search = true
1319
1327
 
1320
1328
  case args.size
1321
- when ONE
1322
- @elm_ = element_1(*args)
1323
- when TWO
1324
- @elm_ = element_2(*args)
1325
- when THREE
1326
- @elm_ = element_3(*args)
1327
- when FOUR
1328
- @elm_ = element_4(*args)
1329
- when FIVE
1330
- @elm_ = element_5(*args)
1329
+ when ONE
1330
+ @elm_ = element_1(*args)
1331
+ when TWO
1332
+ @elm_ = element_2(*args)
1333
+ when THREE
1334
+ @elm_ = element_3(*args)
1335
+ when FOUR
1336
+ @elm_ = element_4(*args)
1337
+ when FIVE
1338
+ @elm_ = element_5(*args)
1331
1339
  end
1332
1340
 
1333
1341
  if !@elm_
@@ -1342,35 +1350,37 @@ module Meteor
1342
1350
 
1343
1351
  @position = 0
1344
1352
 
1345
- while (@res = @pattern.match(@root.document,@position))
1353
+ while (@res = @pattern.match(@root.document, @position))
1346
1354
  @position = @res.end(0)
1347
1355
  # puts @res[0]
1348
1356
  # if @res
1349
- case args.size
1350
- when ONE
1351
- if @elm_.empty
1352
- element_with_1(@elm_.name)
1353
- else
1354
- element_without_1(@elm_.name)
1355
- end
1356
- when TWO,THREE
1357
- if @elm_.empty
1358
- element_with_3_1(@elm_.name)
1359
- else
1360
- element_without_3(@elm_.name)
1361
- end
1362
- when FOUR,FIVE
1363
- if @elm_.empty
1364
- element_with_5_1(@elm_.name)
1365
- else
1366
- element_without_5(@elm_.name)
1367
- end
1357
+ case args.size
1358
+ when ONE
1359
+ if @elm_.empty
1360
+ element_with_1(@elm_.name)
1361
+ else
1362
+ element_without_1(@elm_.name)
1368
1363
  end
1369
1364
 
1370
- @elm_.pattern = Regexp.quote(@elm_.document)
1371
- elm_arr << @elm_
1365
+ when TWO, THREE
1366
+ if @elm_.empty
1367
+ element_with_3_1(@elm_.name)
1368
+ else
1369
+ element_without_3(@elm_.name)
1370
+ end
1372
1371
 
1373
- @element_cache.store(@elm_.object_id, @elm_)
1372
+ when FOUR, FIVE
1373
+ if @elm_.empty
1374
+ element_with_5_1(@elm_.name)
1375
+ else
1376
+ element_without_5(@elm_.name)
1377
+ end
1378
+ end
1379
+
1380
+ @elm_.pattern = Regexp.quote(@elm_.document)
1381
+ elm_arr << @elm_
1382
+
1383
+ @element_cache.store(@elm_.object_id, @elm_)
1374
1384
 
1375
1385
  # else
1376
1386
  # break
@@ -1389,75 +1399,77 @@ module Meteor
1389
1399
  # @return [Array<Meteor::Element>] element array (要素配列)
1390
1400
  #
1391
1401
  def find(selector)
1392
- open_count = selector.count('[')
1402
+ open_count = selector.count("[")
1393
1403
 
1394
1404
  case open_count
1395
- when ZERO
1396
- if selector.count('#.') == 0
1397
- if @res = @@pattern_find_1.match(selector)
1398
- elements_(@res[1])
1399
- else
1400
- nil
1401
- end
1402
- elsif selector.count('#') == 1
1403
- if selector[0] == '#'
1404
- if @res = @@pattern_find_2_1.match(selector)
1405
- elements_('id', @res[1])
1406
- else
1407
- nil
1408
- end
1409
- else
1410
- if @res = @@pattern_find_3_2.match(selector)
1411
- elements_(@res[1], 'id', @res[2])
1412
- else
1413
- nil
1414
- end
1415
- end
1416
- elsif selector.count('.') == 1
1417
- if selector[0] == '.'
1418
- if @res = @@pattern_find_2_2.match(selector)
1419
- elements_('class', @res[1])
1420
- else
1421
- nil
1422
- end
1423
- else
1424
- if @res = @@pattern_find_3_3.match(selector)
1425
- elements_(@res[1], 'class', @res[2])
1426
- else
1427
- nil
1428
- end
1429
- end
1405
+ when ZERO
1406
+ if selector.count("#.") == 0
1407
+ if @res = @@pattern_find_1.match(selector)
1408
+ elements_(@res[1])
1409
+ else
1410
+ nil
1430
1411
  end
1431
- when ONE
1432
- if selector[0] == '['
1433
- if @res = @@pattern_find_2_3.match(selector)
1434
- elements_(@res[1], @res[2])
1412
+ elsif selector.count("#") == 1
1413
+ if selector[0] == "#"
1414
+ if @res = @@pattern_find_2_1.match(selector)
1415
+ elements_("id", @res[1])
1435
1416
  else
1436
1417
  nil
1437
1418
  end
1438
1419
  else
1439
- if @res = @@pattern_find_3_1.match(selector)
1440
- elements_(@res[1], @res[2], @res[3])
1420
+ if @res = @@pattern_find_3_2.match(selector)
1421
+ elements_(@res[1], "id", @res[2])
1441
1422
  else
1442
1423
  nil
1443
1424
  end
1444
1425
  end
1445
- when 2
1446
- if selector[0] == '['
1447
- if @res = @@pattern_find_4.match(selector)
1448
- elements_(@res[1], @res[2], @res[3], @res[4])
1426
+ elsif selector.count(".") == 1
1427
+ if selector[0] == "."
1428
+ if @res = @@pattern_find_2_2.match(selector)
1429
+ elements_("class", @res[1])
1449
1430
  else
1450
1431
  nil
1451
1432
  end
1452
1433
  else
1453
- if @res = @@pattern_find_5.match(selector)
1454
- elements_(@res[1], @res[2], @res[3], @res[4], @res[5])
1434
+ if @res = @@pattern_find_3_3.match(selector)
1435
+ elements_(@res[1], "class", @res[2])
1455
1436
  else
1456
1437
  nil
1457
1438
  end
1458
1439
  end
1440
+ end
1441
+
1442
+ when ONE
1443
+ if selector[0] == "["
1444
+ if @res = @@pattern_find_2_3.match(selector)
1445
+ elements_(@res[1], @res[2])
1446
+ else
1447
+ nil
1448
+ end
1459
1449
  else
1460
- nil
1450
+ if @res = @@pattern_find_3_1.match(selector)
1451
+ elements_(@res[1], @res[2], @res[3])
1452
+ else
1453
+ nil
1454
+ end
1455
+ end
1456
+
1457
+ when 2
1458
+ if selector[0] == "["
1459
+ if @res = @@pattern_find_4.match(selector)
1460
+ elements_(@res[1], @res[2], @res[3], @res[4])
1461
+ else
1462
+ nil
1463
+ end
1464
+ else
1465
+ if @res = @@pattern_find_5.match(selector)
1466
+ elements_(@res[1], @res[2], @res[3], @res[4], @res[5])
1467
+ else
1468
+ nil
1469
+ end
1470
+ end
1471
+ else
1472
+ nil
1461
1473
  end
1462
1474
  end
1463
1475
 
@@ -1479,18 +1491,18 @@ module Meteor
1479
1491
  # @param [String,Symbol] attr_name attribute name (属性名)
1480
1492
  # @return [String] attribute value (属性値)
1481
1493
  #
1482
- def attr(elm, attr,*args)
1494
+ def attr(elm, attr, *args)
1483
1495
  if attr.kind_of?(String) || attr.kind_of?(Symbol)
1484
1496
  case args.length
1485
- when ZERO
1486
- get_attr_value(elm, attr.to_s)
1487
- when ONE
1488
- if args[0] != nil
1489
- elm.document_sync = true
1490
- set_attribute_3(elm, attr.to_s,args[0])
1491
- else
1492
- remove_attr(elm, attr.to_s)
1493
- end
1497
+ when ZERO
1498
+ get_attr_value(elm, attr.to_s)
1499
+ when ONE
1500
+ if args[0] != nil
1501
+ elm.document_sync = true
1502
+ set_attribute_3(elm, attr.to_s, args[0])
1503
+ else
1504
+ remove_attr(elm, attr.to_s)
1505
+ end
1494
1506
  end
1495
1507
 
1496
1508
  elsif attr.kind_of?(Hash) && attr.size == 1
@@ -1500,11 +1512,11 @@ module Meteor
1500
1512
  else
1501
1513
  remove_attr(elm, attr.keys[0].to_s)
1502
1514
  end
1503
- # elsif attrs.kind_of?(Hash) && attrs.size >= 1
1504
- # elm.document_sync = true
1505
- # attrs.each{|name,value|
1506
- # set_attribute_3(elm,name,value)
1507
- # }
1515
+ # elsif attrs.kind_of?(Hash) && attrs.size >= 1
1516
+ # elm.document_sync = true
1517
+ # attrs.each{|name,value|
1518
+ # set_attribute_3(elm,name,value)
1519
+ # }
1508
1520
  else
1509
1521
  raise ArgumentError
1510
1522
  end
@@ -1523,6 +1535,7 @@ module Meteor
1523
1535
  # update attributes (属性群の更新)
1524
1536
  edit_attrs_(elm, attr_name, attr_value)
1525
1537
  end
1538
+
1526
1539
  elm
1527
1540
  end
1528
1541
 
@@ -1534,26 +1547,26 @@ module Meteor
1534
1547
  # @res = @pattern.match(elm.attributes)
1535
1548
 
1536
1549
  # (検索対象属性の存在判定)
1537
- if elm.attributes.include?(String.new(' ') << attr_name << '="')
1550
+ if elm.attributes.include?(String.new(" ") << attr_name << "=\"")
1538
1551
  @_attr_value = attr_value
1539
1552
 
1540
1553
  # replace attribute (属性の置換)
1541
- @pattern = Meteor::Core::Util::PatternCache.get(String.new('') << attr_name << '="[^"]*"')
1554
+ @pattern = Meteor::Core::Util::PatternCache.get(String.new("") << attr_name << "=\"[^\"]*\"")
1542
1555
  # @pattern = Meteor::Core::Util::PatternCache.get("#{attr_name}=\"[^\"]*\"")
1543
1556
 
1544
- elm.attributes.sub!(@pattern, String.new('') << attr_name << '="' << @_attr_value << '"')
1557
+ elm.attributes.sub!(@pattern, String.new("") << attr_name << "=\"" << @_attr_value << "\"")
1545
1558
  # elm.attributes.sub!(@pattern, "#{attr_name}=\"#{@_attr_value}\"")
1546
1559
  else
1547
1560
  # add an attribute to attrubutes (属性文字列の最後に新規の属性を追加する)
1548
1561
  @_attr_value = attr_value
1549
1562
 
1550
- if '' != elm.attributes && '' != elm.attributes.strip
1551
- elm.attributes = String.new('') << ' ' << elm.attributes.strip
1563
+ if "" != elm.attributes && "" != elm.attributes.strip
1564
+ elm.attributes = String.new("") << " " << elm.attributes.strip
1552
1565
  else
1553
- elm.attributes = String.new('')
1566
+ elm.attributes = String.new("")
1554
1567
  end
1555
1568
 
1556
- elm.attributes << ' ' << attr_name << '="' << @_attr_value << '"'
1569
+ elm.attributes << " " << attr_name << "=\"" << @_attr_value << "\""
1557
1570
  # elm.attributes << " #{attr_name}=\"#{@_attr_value}\""
1558
1571
  end
1559
1572
  end
@@ -1575,7 +1588,7 @@ module Meteor
1575
1588
  def get_attr_value_(elm, attr_name)
1576
1589
 
1577
1590
  # attribute search pattern (属性検索用パターン)
1578
- @pattern = Meteor::Core::Util::PatternCache.get(String.new('') << attr_name << '="([^"]*)"')
1591
+ @pattern = Meteor::Core::Util::PatternCache.get(String.new("") << attr_name << "=\"([^\"]*)\"")
1579
1592
  # @pattern = Meteor::Core::Util::PatternCache.get("#{attr_name}=\"([^\"]*)\"")
1580
1593
 
1581
1594
  @res = @pattern.match(elm.attributes)
@@ -1597,25 +1610,25 @@ module Meteor
1597
1610
  # @param [Meteor::element] elm element (要素)
1598
1611
  # @return [Hash<String,String>] attribute map (要素マップ)
1599
1612
  #
1600
- def attrs(elm,*args)
1613
+ def attrs(elm, *args)
1601
1614
  case args.length
1602
- when ZERO
1603
- get_attrs(elm)
1604
- when ONE
1605
- if args[0].kind_of?(Hash)
1606
- if args[0].size == 1
1607
- elm.document_sync = true
1608
- set_attribute_3(elm, args[0].keys[0].to_s, args[0].values[0])
1609
- elsif args[0].size >= 1
1610
- set_attrs(elm, args[0])
1611
- else
1612
- raise ArgumentError
1613
- end
1615
+ when ZERO
1616
+ get_attrs(elm)
1617
+ when ONE
1618
+ if args[0].kind_of?(Hash)
1619
+ if args[0].size == 1
1620
+ elm.document_sync = true
1621
+ set_attribute_3(elm, args[0].keys[0].to_s, args[0].values[0])
1622
+ elsif args[0].size >= 1
1623
+ set_attrs(elm, args[0])
1614
1624
  else
1615
1625
  raise ArgumentError
1616
1626
  end
1617
1627
  else
1618
1628
  raise ArgumentError
1629
+ end
1630
+ else
1631
+ raise ArgumentError
1619
1632
  end
1620
1633
  end
1621
1634
 
@@ -1649,6 +1662,7 @@ module Meteor
1649
1662
  set_attribute_3(elm, name.to_s, value)
1650
1663
  end
1651
1664
  end
1665
+
1652
1666
  elm
1653
1667
  end
1654
1668
 
@@ -1665,17 +1679,17 @@ module Meteor
1665
1679
  # @param [Meteor::Element] elm element (要素)
1666
1680
  # @return [Meteor::AttributeMap] attribute map (属性マップ)
1667
1681
  #
1668
- def attr_map(elm,*args)
1682
+ def attr_map(elm, *args)
1669
1683
  case args.length
1670
- when ZERO
1671
- get_attr_map(elm)
1672
- when ONE
1673
- # if elm.kind_of?(Meteor::Element) && args[0].kind_of?(Meteor::AttributeMap)
1674
- elm.document_sync = true
1675
- set_attr_map(elm, args[0])
1676
- # end
1677
- else
1678
- raise ArgumentError
1684
+ when ZERO
1685
+ get_attr_map(elm)
1686
+ when ONE
1687
+ # if elm.kind_of?(Meteor::Element) && args[0].kind_of?(Meteor::AttributeMap)
1688
+ elm.document_sync = true
1689
+ set_attr_map(elm, args[0])
1690
+ # end
1691
+ else
1692
+ raise ArgumentError
1679
1693
  end
1680
1694
  end
1681
1695
 
@@ -1690,6 +1704,7 @@ module Meteor
1690
1704
  elm.attributes.scan(@@pattern_get_attrs_map) do |a, b|
1691
1705
  attrs.store(a, unescape(b))
1692
1706
  end
1707
+
1693
1708
  attrs.recordable = true
1694
1709
 
1695
1710
  attrs
@@ -1713,6 +1728,7 @@ module Meteor
1713
1728
  end
1714
1729
  end
1715
1730
  end
1731
+
1716
1732
  elm
1717
1733
  end
1718
1734
 
@@ -1738,24 +1754,24 @@ module Meteor
1738
1754
  #
1739
1755
  def content(*args)
1740
1756
  case args.length
1741
- when ONE
1742
- # if args[0].kind_of?(Meteor::Element)
1743
- get_content_1(args[0])
1757
+ when ONE
1758
+ # if args[0].kind_of?(Meteor::Element)
1759
+ get_content_1(args[0])
1744
1760
  # else
1745
1761
  # raise ArgumentError
1746
1762
  # end
1747
- when TWO
1748
- # if args[0].kind_of?(Meteor::Element) && args[1].kind_of?(String)
1749
- args[0].document_sync = true
1750
- set_content_2(args[0], args[1].to_s)
1751
- # else
1752
- # raise ArgumentError
1753
- # end
1754
- when THREE
1755
- args[0].document_sync = true
1756
- set_content_3(args[0], args[1].to_s, args[2])
1757
- else
1758
- raise ArgumentError
1763
+ when TWO
1764
+ # if args[0].kind_of?(Meteor::Element) && args[1].kind_of?(String)
1765
+ args[0].document_sync = true
1766
+ set_content_2(args[0], args[1].to_s)
1767
+ # else
1768
+ # raise ArgumentError
1769
+ # end
1770
+ when THREE
1771
+ args[0].document_sync = true
1772
+ set_content_3(args[0], args[1].to_s, args[2])
1773
+ else
1774
+ raise ArgumentError
1759
1775
  end
1760
1776
  end
1761
1777
 
@@ -1766,11 +1782,12 @@ module Meteor
1766
1782
  # @param [true,false] entity_ref entity reference flag (エンティティ参照フラグ)
1767
1783
  # @return [Meteor::Element] element (要素)
1768
1784
  #
1769
- def set_content_3(elm, content, entity_ref=true)
1785
+ def set_content_3(elm, content, entity_ref = true)
1770
1786
 
1771
1787
  if entity_ref || !elm.raw_content
1772
1788
  escape_content(content, elm)
1773
1789
  end
1790
+
1774
1791
  elm.mixed_content = content
1775
1792
  elm
1776
1793
  end
@@ -1788,6 +1805,7 @@ module Meteor
1788
1805
  unless elm.raw_content
1789
1806
  escape_content(content, elm)
1790
1807
  end
1808
+
1791
1809
  elm.mixed_content = content
1792
1810
  elm
1793
1811
  end
@@ -1830,10 +1848,10 @@ module Meteor
1830
1848
 
1831
1849
  def remove_attrs_(elm, attr_name)
1832
1850
  # attribute search pattern (属性検索用パターン)
1833
- @pattern = Meteor::Core::Util::PatternCache.get(String.new('') << attr_name << '="[^"]*"\\s?')
1851
+ @pattern = Meteor::Core::Util::PatternCache.get(String.new("") << attr_name << "=\"[^\"]*\"\\s?")
1834
1852
  # @pattern = Meteor::Core::Util::PatternCache.get("#{attr_name}=\"[^\"]*\"\\s?")
1835
1853
  # replace attrubute (属性の置換)
1836
- elm.attributes.sub!(@pattern, '')
1854
+ elm.attributes.sub!(@pattern, "")
1837
1855
  end
1838
1856
 
1839
1857
  private :remove_attrs_
@@ -1861,18 +1879,19 @@ module Meteor
1861
1879
  #
1862
1880
  def cxtag(*args)
1863
1881
  case args.length
1864
- when ONE
1865
- cxtag_1(args[0].to_s)
1866
- if @elm_
1867
- @element_cache.store(@elm_.object_id, @elm_)
1868
- end
1869
- when TWO
1870
- cxtag_2(args[0].to_s, args[1].to_s)
1871
- if @elm_
1872
- @element_cache.store(@elm_.object_id, @elm_)
1873
- end
1874
- else
1875
- raise ArgumentError
1882
+ when ONE
1883
+ cxtag_1(args[0].to_s)
1884
+ if @elm_
1885
+ @element_cache.store(@elm_.object_id, @elm_)
1886
+ end
1887
+
1888
+ when TWO
1889
+ cxtag_2(args[0].to_s, args[1].to_s)
1890
+ if @elm_
1891
+ @element_cache.store(@elm_.object_id, @elm_)
1892
+ end
1893
+ else
1894
+ raise ArgumentError
1876
1895
  end
1877
1896
  end
1878
1897
 
@@ -1931,7 +1950,7 @@ module Meteor
1931
1950
 
1932
1951
  @_id = Regexp.quote(id)
1933
1952
 
1934
- @pattern_cc = String.new('') << '<!--\\s@([^<>]*)\\s[^<>]*id="' << @_id << '"'
1953
+ @pattern_cc = String.new("") << "<!--\\s@([^<>]*)\\s[^<>]*id=\"" << @_id << "\""
1935
1954
  # @pattern_cc = "<!--\\s@([^<>]*)\\s[^<>]*id=\"#{@_id}\""
1936
1955
 
1937
1956
  @pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
@@ -1980,8 +1999,9 @@ module Meteor
1980
1999
  # edit_pattern_(item)
1981
2000
  end
1982
2001
  else
1983
- replace(item, '')
2002
+ replace(item, "")
1984
2003
  end
2004
+
1985
2005
  item.usable = false
1986
2006
  end
1987
2007
  end
@@ -1990,7 +2010,7 @@ module Meteor
1990
2010
  protected :reflect
1991
2011
 
1992
2012
  def edit_document_1(elm)
1993
- edit_document_2(elm, '/>')
2013
+ edit_document_2(elm, "/>")
1994
2014
  end
1995
2015
 
1996
2016
  private :edit_document_1
@@ -2016,17 +2036,20 @@ module Meteor
2016
2036
  # @root.hookDocument << @root.element.attributes << '-->'
2017
2037
  # @root.hookDocument << @root.element.mixed_content << '<!-- /@'
2018
2038
  # @root.hookDocument << @root.element.name << ' -->'
2019
- self.document_hook << "<!-- @#{self.element_hook.name} #{self.element_hook.attributes}-->#{self.element_hook.mixed_content}<!-- /@#{self.element_hook.name} -->"
2039
+ self.document_hook <<
2040
+ "<!-- @#{self.element_hook.name} #{self.element_hook.attributes}-->#{self.element_hook.mixed_content}<!-- /@#{self.element_hook.name} -->"
2020
2041
 
2021
2042
  # self.document_hook << @root.kaigyo_code << "<!-- @#{self.element_hook.name} #{self.element_hook.attributes}-->#{self.element_hook.mixed_content}<!-- /@#{self.element_hook.name} -->"
2022
2043
  else
2023
2044
  # @root.hookDocument << "<" << @root.element.name
2024
2045
  # @root.hookDocument << @root.element.attributes << '>' << @root.element.mixed_content
2025
2046
  # @root.hookDocument << '</' << @root.element.name << '>'
2026
- self.document_hook << "<#{self.element_hook.name}#{self.element_hook.attributes}>#{self.element_hook.mixed_content}</#{self.element_hook.name}>"
2047
+ self.document_hook <<
2048
+ "<#{self.element_hook.name}#{self.element_hook.attributes}>#{self.element_hook.mixed_content}</#{self.element_hook.name}>"
2027
2049
 
2028
2050
  # self.document_hook << @root.kaigyo_code << "<#{self.element_hook.name}#{self.element_hook.attributes}>#{self.element_hook.mixed_content}</#{self.element_hook.name}>"
2029
2051
  end
2052
+
2030
2053
  self.element_hook = Element.new!(self.element_hook.origin, self)
2031
2054
  else
2032
2055
  reflect
@@ -2037,17 +2060,20 @@ module Meteor
2037
2060
  # @root.hookDocument << @_attributes << '-->'
2038
2061
  # @root.hookDocument << @root.document << '<!-- /@'
2039
2062
  # @root.hookDocument << @root.element.name << ' -->'
2040
- self.document_hook << "<!-- @#{self.element_hook.name} #{@_attributes}-->#{@root.document}<!-- /@#{self.element_hook.name} -->"
2063
+ self.document_hook <<
2064
+ "<!-- @#{self.element_hook.name} #{@_attributes}-->#{@root.document}<!-- /@#{self.element_hook.name} -->"
2041
2065
 
2042
2066
  # self.document_hook << @root.kaigyo_code << "<!-- @#{self.element_hook.name} #{@_attributes}-->#{@root.document}<!-- /@#{self.element_hook.name} -->"
2043
2067
  else
2044
2068
  # @root.hookDocument << "<" << @root.element.name
2045
2069
  # @root.hookDocument << @_attributes << '>' << @root.document
2046
2070
  # @root.hookDocument << '</' << @root.element.name << '>'
2047
- self.document_hook << "<#{self.element_hook.name}#{@_attributes}>#{@root.document}</#{self.element_hook.name}>"
2071
+ self.document_hook <<
2072
+ "<#{self.element_hook.name}#{@_attributes}>#{@root.document}</#{self.element_hook.name}>"
2048
2073
 
2049
2074
  # self.document_hook << @root.kaigyo_code << "<#{self.element_hook.name}#{@_attributes}>#{@root.document}</#{self.element_hook.name}>"
2050
2075
  end
2076
+
2051
2077
  self.element_hook = Element.new!(self.element_hook.origin, self)
2052
2078
  end
2053
2079
  else
@@ -2061,10 +2087,10 @@ module Meteor
2061
2087
  def clean
2062
2088
  # replace CX start tag (CX開始タグ置換)
2063
2089
  @pattern = @@pattern_clean1
2064
- @root.document.gsub!(@pattern, '')
2090
+ @root.document.gsub!(@pattern, "")
2065
2091
  # rplace CX end tag (CX終了タグ置換)
2066
2092
  @pattern = @@pattern_clean2
2067
- @root.document.gsub!(@pattern, '')
2093
+ @root.document.gsub!(@pattern, "")
2068
2094
  # @root.document << "<!-- Powered by Meteor (C)Yasumasa Ashida -->"
2069
2095
  end
2070
2096
 
@@ -2090,6 +2116,7 @@ module Meteor
2090
2116
  else
2091
2117
  pif2.root_element.document = String.new(elm.document)
2092
2118
  end
2119
+
2093
2120
  pif2.root_element.kaigyo_code = elm.parser.root_element.kaigyo_code
2094
2121
 
2095
2122
  @elm_
@@ -2144,6 +2171,7 @@ module Meteor
2144
2171
  return true
2145
2172
  end
2146
2173
  end
2174
+
2147
2175
  false
2148
2176
  end
2149
2177
 
@@ -2161,18 +2189,18 @@ module Meteor
2161
2189
 
2162
2190
  def create(pif)
2163
2191
  case pif.doc_type
2164
- when Parser::HTML4
2165
- Meteor::Ml::Html4::ParserImpl.new
2166
- when Parser::XHTML4
2167
- Meteor::Ml::Xhtml4::ParserImpl.new
2168
- when Parser::HTML
2169
- Meteor::Ml::Html::ParserImpl.new
2170
- when Parser::XHTML
2171
- Meteor::Ml::Xhtml::ParserImpl.new
2172
- when Parser::XML
2173
- Meteor::Ml::Xml::ParserImpl.new
2174
- else
2175
- nil
2192
+ when Parser::HTML
2193
+ Meteor::Ml::Html::ParserImpl.new
2194
+ when Parser::XML
2195
+ Meteor::Ml::Xml::ParserImpl.new
2196
+ when Parser::XHTML
2197
+ Meteor::Ml::Xhtml::ParserImpl.new
2198
+ when Parser::HTML4
2199
+ Meteor::Ml::Html4::ParserImpl.new
2200
+ when Parser::XHTML4
2201
+ Meteor::Ml::Xhtml4::ParserImpl.new
2202
+ else
2203
+ nil
2176
2204
  end
2177
2205
  end
2178
2206