asip-meteor 0.9.0.6 → 0.9.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +1 -1
  2. data/lib/meteor.rb +155 -151
  3. metadata +1 -1
data/README CHANGED
@@ -26,5 +26,5 @@ by asip <ys.ashida@gmail.com>
26
26
  == Copyright
27
27
 
28
28
  Author:: asip <ys.ashida@gmail.com>
29
- Copyright:: Copyright (c) 2008 asip
29
+ Copyright:: Copyright (c) 2009 asip
30
30
  License:: LGPL V2.1
data/lib/meteor.rb CHANGED
@@ -18,7 +18,7 @@
18
18
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
19
  #
20
20
  # @author Yasumasa Ashida
21
- # @version 0.9.0.6
21
+ # @version 0.9.0.7
22
22
  #
23
23
  if RUBY_VERSION < '1.9.0' then
24
24
  require 'kconv'
@@ -27,7 +27,7 @@ end
27
27
 
28
28
  module Meteor
29
29
 
30
- VERSION = "0.9.0.6"
30
+ VERSION = "0.9.0.7"
31
31
 
32
32
  #
33
33
  # 要素クラス
@@ -187,11 +187,11 @@ module Meteor
187
187
  #
188
188
  def initialize()
189
189
  #コンテントタイプ
190
- @contentType = ''
190
+ #@contentType = ''
191
191
  #改行コード
192
- @kaigyoCode = ''
192
+ #@kaigyoCode = ''
193
193
  #文字コード
194
- @characterEncoding=''
194
+ #@characterEncoding=''
195
195
 
196
196
  #フックドキュメント
197
197
  @hookDocument =''
@@ -574,95 +574,95 @@ module Meteor
574
574
  class Kernel < Meteor::Parser
575
575
 
576
576
  EMPTY = ''
577
- SPACE = " "
578
- DOUBLE_QUATATION = "\""
579
- TAG_OPEN = "<"
580
- TAG_OPEN3 = "</"
581
- TAG_OPEN4 = "<\\\\/"
582
- TAG_CLOSE = ">"
583
- TAG_CLOSE2 = "\\/>"
584
- TAG_CLOSE3 = "/>"
585
- ATTR_EQ = "=\""
577
+ SPACE = ' '
578
+ DOUBLE_QUATATION = '"'
579
+ TAG_OPEN = '<'
580
+ TAG_OPEN3 = '</'
581
+ TAG_OPEN4 = '<\\\\/'
582
+ TAG_CLOSE = '>'
583
+ TAG_CLOSE2 = '\\/>'
584
+ TAG_CLOSE3 = '/>'
585
+ ATTR_EQ = '="'
586
586
  #element
587
587
  #TAG_SEARCH_1_1 = "([^<>]*)>(((?!(<\\/"
588
- TAG_SEARCH_1_1 = "(\\s?[^<>]*)>(((?!("
588
+ TAG_SEARCH_1_1 = '(\\s?[^<>]*)>(((?!('
589
589
  #TAG_SEARCH_1_2 = ")).)*)<\\/";
590
- TAG_SEARCH_1_2 = "[^<>]*>)).)*)<\\/"
591
- TAG_SEARCH_1_3 = "(\\s?[^<>]*)\\/>"
590
+ TAG_SEARCH_1_2 = '[^<>]*>)).)*)<\\/'
591
+ TAG_SEARCH_1_3 = '(\\s?[^<>]*)\\/>'
592
592
  #TAG_SEARCH_1_4 = "([^<>\\/]*)>"
593
- TAG_SEARCH_1_4 = "(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
594
- TAG_SEARCH_1_4_2 = "(\\s[^<>]*)>"
593
+ TAG_SEARCH_1_4 = '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
594
+ TAG_SEARCH_1_4_2 = '(\\s[^<>]*)>'
595
595
 
596
- TAG_SEARCH_NC_1_1 = "\\s?[^<>]*>((?!("
597
- TAG_SEARCH_NC_1_2 = "[^<>]*>)).)*<\\/"
598
- TAG_SEARCH_NC_1_3 = "\\s?[^<>]*\\/>"
599
- TAG_SEARCH_NC_1_4 = "(?:\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
600
- TAG_SEARCH_NC_1_4_2 = "\\s[^<>]*>"
596
+ TAG_SEARCH_NC_1_1 = '\\s?[^<>]*>((?!('
597
+ TAG_SEARCH_NC_1_2 = '[^<>]*>)).)*<\\/'
598
+ TAG_SEARCH_NC_1_3 = '\\s?[^<>]*\\/>'
599
+ TAG_SEARCH_NC_1_4 = '(?:\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
600
+ TAG_SEARCH_NC_1_4_2 = '\\s[^<>]*>'
601
601
 
602
602
  #TAG_SEARCH_2_1 = "\\s([^<>]*"
603
- TAG_SEARCH_2_1 = "(\\s[^<>]*"
604
- TAG_SEARCH_2_1_2 = "(\\s[^<>]*(?:"
603
+ TAG_SEARCH_2_1 = '(\\s[^<>]*'
604
+ TAG_SEARCH_2_1_2 = '(\\s[^<>]*(?:'
605
605
  #TAG_SEARCH_2_2 = "\"[^<>]*)>(((?!(<\\/"
606
- TAG_SEARCH_2_2 = "\"[^<>]*)>(((?!("
607
- TAG_SEARCH_2_2_2 = "\")[^<>]*)>(((?!("
608
- TAG_SEARCH_2_3 = "\"[^<>]*)"
606
+ TAG_SEARCH_2_2 = '"[^<>]*)>(((?!('
607
+ TAG_SEARCH_2_2_2 = '")[^<>]*)>(((?!('
608
+ TAG_SEARCH_2_3 = '"[^<>]*)'
609
609
  TAG_SEARCH_2_3_2 = "\"[^<>]*)\\/>"
610
610
  TAG_SEARCH_2_3_2_2 = "\")[^<>]*)\\/>"
611
611
  #TAG_SEARCH_2_4 = "\"[^<>\\/]*>"
612
- TAG_SEARCH_2_4 = "(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
612
+ TAG_SEARCH_2_4 = '(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
613
613
  #TAG_SEARCH_2_4_2 = "\"[^<>\\/]*)>"
614
- TAG_SEARCH_2_4_2 = "(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))"
615
- TAG_SEARCH_2_4_2_2 = "\")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))"
616
- TAG_SEARCH_2_4_2_3 = "\""
617
- TAG_SEARCH_2_4_3 = "\"[^<>]*)>"
618
- TAG_SEARCH_2_4_3_2 = "\")[^<>]*)>"
619
- TAG_SEARCH_2_4_4 = "\"[^<>]*>"
620
-
621
- TAG_SEARCH_2_6 = "\"[^<>]*"
622
- TAG_SEARCH_2_7 = "\"|"
623
-
624
- TAG_SEARCH_NC_2_1 = "\\s[^<>]*"
625
- TAG_SEARCH_NC_2_1_2 = "\\s[^<>]*(?:"
626
- TAG_SEARCH_NC_2_2 = "\"[^<>]*>((?!("
627
- TAG_SEARCH_NC_2_2_2 = "\")[^<>]*>((?!("
628
- TAG_SEARCH_NC_2_3 = "\"[^<>]*)"
629
- TAG_SEARCH_NC_2_3_2 = "\"[^<>]*\\/>"
630
- TAG_SEARCH_NC_2_3_2_2 = "\")[^<>]*\\/>"
631
- TAG_SEARCH_NC_2_4 = "(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
632
- TAG_SEARCH_NC_2_4_2 = "(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
633
- TAG_SEARCH_NC_2_4_2_2 = "\")(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
634
- TAG_SEARCH_NC_2_4_2_3 = "\""
635
- TAG_SEARCH_NC_2_4_3 = "\"[^<>]*>"
636
- TAG_SEARCH_NC_2_4_3_2 = "\")[^<>]*>"
637
- TAG_SEARCH_NC_2_4_4 = "\"[^<>]*>"
638
- TAG_SEARCH_NC_2_6 = "\"[^<>]*"
639
- TAG_SEARCH_NC_2_7 = "\"|"
614
+ TAG_SEARCH_2_4_2 = '(?:[^<>\\/]*>|(?:(?!([^<>]*\\/>))[^<>]*>)))'
615
+ TAG_SEARCH_2_4_2_2 = '")([^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>)))'
616
+ TAG_SEARCH_2_4_2_3 = '"'
617
+ TAG_SEARCH_2_4_3 = '"[^<>]*)>'
618
+ TAG_SEARCH_2_4_3_2 = '")[^<>]*)>'
619
+ TAG_SEARCH_2_4_4 = '"[^<>]*>'
620
+
621
+ TAG_SEARCH_2_6 = '"[^<>]*'
622
+ TAG_SEARCH_2_7 = '"|'
623
+
624
+ TAG_SEARCH_NC_2_1 = '\\s[^<>]*'
625
+ TAG_SEARCH_NC_2_1_2 = '\\s[^<>]*(?:'
626
+ TAG_SEARCH_NC_2_2 = '"[^<>]*>((?!('
627
+ TAG_SEARCH_NC_2_2_2 = '")[^<>]*>((?!('
628
+ TAG_SEARCH_NC_2_3 = '"[^<>]*)'
629
+ TAG_SEARCH_NC_2_3_2 = '"[^<>]*\\/>'
630
+ TAG_SEARCH_NC_2_3_2_2 = '")[^<>]*\\/>'
631
+ TAG_SEARCH_NC_2_4 = '(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
632
+ TAG_SEARCH_NC_2_4_2 = '(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
633
+ TAG_SEARCH_NC_2_4_2_2 = '")(?:[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
634
+ TAG_SEARCH_NC_2_4_2_3 = '"'
635
+ TAG_SEARCH_NC_2_4_3 = '"[^<>]*>'
636
+ TAG_SEARCH_NC_2_4_3_2 = '")[^<>]*>'
637
+ TAG_SEARCH_NC_2_4_4 = '"[^<>]*>'
638
+ TAG_SEARCH_NC_2_6 = '"[^<>]*'
639
+ TAG_SEARCH_NC_2_7 = '"|'
640
640
 
641
- TAG_SEARCH_3_1 = "<([^<>\"]*)\\s[^<>]*"
642
- TAG_SEARCH_3_1_2 = "<([^<>\"]*)\\s([^<>]*"
643
- TAG_SEARCH_3_1_2_2 = "<([^<>\"]*)\\s([^<>]*("
641
+ TAG_SEARCH_3_1 = '<([^<>"]*)\\s[^<>]*'
642
+ TAG_SEARCH_3_1_2 = '<([^<>"]*)\\s([^<>]*'
643
+ TAG_SEARCH_3_1_2_2 = '<([^<>"]*)\\s([^<>]*('
644
644
 
645
- TAG_SEARCH_3_2 = "\"[^<>]*\\/>"
646
- TAG_SEARCH_3_2_2 = "\"[^<>]*)\\/>"
647
- TAG_SEARCH_3_2_2_2 = "\")[^<>]*)\\/>"
645
+ TAG_SEARCH_3_2 = '"[^<>]*\\/>'
646
+ TAG_SEARCH_3_2_2 = '"[^<>]*)\\/>'
647
+ TAG_SEARCH_3_2_2_2 = '")[^<>]*)\\/>'
648
648
 
649
- TAG_SEARCH_4_1 = "(\\s[^<>\\/]*)>("
650
- TAG_SEARCH_4_2 = ".*?<"
649
+ TAG_SEARCH_4_1 = '(\\s[^<>\\/]*)>('
650
+ TAG_SEARCH_4_2 = '.*?<'
651
651
  #TAG_SEARCH_4_3 = "\\s[^<>\\/]*>"
652
- TAG_SEARCH_4_3 = "(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
653
- TAG_SEARCH_4_4 = "<\\/"
654
- TAG_SEARCH_4_5 = ".*?<\/"
655
- TAG_SEARCH_4_6 = ".*?)<\/"
656
- #TAG_SEARCH_4_7 = "\"[^<>\\/]*)>("
657
- TAG_SEARCH_4_7 = "\"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
658
- TAG_SEARCH_4_7_2 = "\")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
659
-
660
- TAG_SEARCH_NC_3_1 = "<[^<>\"]*\\s[^<>]*"
661
- TAG_SEARCH_NC_3_1_2 = "<([^<>\"]*)\\s(?:[^<>]*"
662
- TAG_SEARCH_NC_3_1_2_2 = "<([^<>\"]*)\\s(?:[^<>]*("
663
- TAG_SEARCH_NC_3_2 = "\"[^<>]*\\/>"
664
- TAG_SEARCH_NC_3_2_2 = "\"[^<>]*)\\/>"
665
- TAG_SEARCH_NC_3_2_2_2 = "\")[^<>]*)\\/>"
652
+ TAG_SEARCH_4_3 = '(\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))'
653
+ TAG_SEARCH_4_4 = '<\\/'
654
+ TAG_SEARCH_4_5 = '.*?<\/'
655
+ TAG_SEARCH_4_6 = '.*?)<\/'
656
+ #TAG_SEARCH_4_7 = '\"[^<>\\/]*)>(''
657
+ TAG_SEARCH_4_7 = '"(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
658
+ TAG_SEARCH_4_7_2 = '")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))('
659
+
660
+ TAG_SEARCH_NC_3_1 = '<[^<>"]*\\s[^<>]*'
661
+ TAG_SEARCH_NC_3_1_2 = '<([^<>"]*)\\s(?:[^<>]*'
662
+ TAG_SEARCH_NC_3_1_2_2 = '<([^<>"]*)\\s(?:[^<>]*('
663
+ TAG_SEARCH_NC_3_2 = '"[^<>]*\\/>'
664
+ TAG_SEARCH_NC_3_2_2 = '"[^<>]*)\\/>'
665
+ TAG_SEARCH_NC_3_2_2_2 = '")[^<>]*)\\/>'
666
666
  #TAG_SEARCH_NC_4_1 = "(?:\\s[^<>\\/]*)>("
667
667
  #TAG_SEARCH_NC_4_2 = ".*?<"
668
668
  #TAG_SEARCH_NC_4_3 = "(?:\\s[^<>\\/]*>|((?!([^<>]*\\/>))[^<>]*>))"
@@ -673,35 +673,35 @@ module Meteor
673
673
  #TAG_SEARCH_NC_4_7_2 = "\")(?:[^<>\\/]*>|(?!([^<>]*\\/>))[^<>]*>))("
674
674
 
675
675
  #setAttribute
676
- SET_ATTR_1 = "=\"[^\"]*\""
676
+ SET_ATTR_1 = '="[^"]*"'
677
677
  #getAttributeValue
678
- GET_ATTR_1 = "=\"([^\"]*)\""
678
+ GET_ATTR_1 = '="([^"]*)"'
679
679
  #attributeMap
680
680
  #todo
681
- GET_ATTRS_MAP = "([^\\s]*)=\"([^\"]*)\""
681
+ GET_ATTRS_MAP = '([^\\s]*)="([^\"]*)"'
682
682
  #removeAttribute
683
- ERASE_ATTR_1 = "=\"[^\"]*\"\\s"
683
+ ERASE_ATTR_1 = '="[^\"]*"\\s'
684
684
 
685
685
  #cxtag
686
- SEARCH_CX_1 = "<!--\\s@"
687
- SEARCH_CX_2 = "\\s([^<>]*id=\""
688
- SEARCH_CX_3 = "\"[^<>]*)-->(((?!(<!--\\s\\/@"
689
- SEARCH_CX_4 = ")).)*)<!--\\s\\/@"
690
- SEARCH_CX_5 = "\\s-->"
691
- SEARCH_CX_6 = "<!--\\s@([^<>]*)\\s[^<>]*id=\""
686
+ SEARCH_CX_1 = '<!--\\s@'
687
+ SEARCH_CX_2 = '\\s([^<>]*id="'
688
+ SEARCH_CX_3 = '\"[^<>]*)-->(((?!(<!--\\s\\/@'
689
+ SEARCH_CX_4 = ')).)*)<!--\\s\\/@'
690
+ SEARCH_CX_5 = '\\s-->'
691
+ SEARCH_CX_6 = '<!--\\s@([^<>]*)\\s[^<>]*id="'
692
692
 
693
693
  #setElementToCXTag
694
- SET_CX_1 = "<!-- @"
695
- SET_CX_2 = "-->"
696
- SET_CX_3 = "<!-- /@"
697
- SET_CX_4 = " -->"
694
+ SET_CX_1 = '<!-- @'
695
+ SET_CX_2 = '-->'
696
+ SET_CX_3 = '<!-- /@'
697
+ SET_CX_4 = ' -->'
698
698
 
699
699
  #setMonoInfo
700
- SET_MONO_1 = "\\A[^<>]*\\Z"
700
+ SET_MONO_1 = '\\A[^<>]*\\Z'
701
701
 
702
702
  #clean
703
- CLEAN_1 = "<!--\\s@[^<>]*\\s[^<>]*(\\s)*-->"
704
- CLEAN_2 = "<!--\\s\\/@[^<>]*(\\s)*-->"
703
+ CLEAN_1 = '<!--\\s@[^<>]*\\s[^<>]*(\\s)*-->'
704
+ CLEAN_2 = '<!--\\s\\/@[^<>]*(\\s)*-->'
705
705
  #escape
706
706
  AND_1 = '&'
707
707
  AND_2 = '&amp;'
@@ -722,9 +722,9 @@ module Meteor
722
722
 
723
723
  ESCAPE_ENTITY_REF = ''
724
724
 
725
- SUB_REGEX1 = "(\\\\*)\\\\([0-9]+)"
726
- SUB_REGEX2 = "\\1\\1\\\\\\\\\\2"
727
- SUB_REGEX3 = "\\1\\1\\1\\1\\\\\\\\\\\\\\\\\\2"
725
+ SUB_REGEX1 = '(\\\\*)\\\\([0-9]+)'
726
+ SUB_REGEX2 = '\\1\\1\\\\\\\\\\2'
727
+ SUB_REGEX3 = '\\1\\1\\1\\1\\\\\\\\\\\\\\\\\\2'
728
728
 
729
729
  @@pattern_get_attrs_map = Regexp.new(GET_ATTRS_MAP)
730
730
 
@@ -1201,7 +1201,6 @@ module Meteor
1201
1201
  private :elementWithContent_3_1
1202
1202
 
1203
1203
  def elementWithContent_3_2(elmName)
1204
- @cnt = 0
1205
1204
 
1206
1205
  @pattern_cc_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1 << @_attrName << ATTR_EQ
1207
1206
  @pattern_cc_1 << @_attrValue << TAG_SEARCH_2_4_2
@@ -1226,7 +1225,9 @@ module Meteor
1226
1225
 
1227
1226
  @pattern_2 = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
1228
1227
  @pattern_1b = Meteor::Core::Util::PatternCache.get(@pattern_cc_1b);
1229
-
1228
+
1229
+ @cnt = 0
1230
+
1230
1231
  create_element_pattern
1231
1232
 
1232
1233
  @pattern_cc = @sbuf
@@ -1414,8 +1415,7 @@ module Meteor
1414
1415
  private :elementWithContent_5_1
1415
1416
 
1416
1417
  def elementWithContent_5_2(elmName)
1417
- @cnt = 0
1418
-
1418
+
1419
1419
  @pattern_cc_1 = '' << TAG_OPEN << @_elmName << TAG_SEARCH_2_1_2 << @_attrName1 << ATTR_EQ
1420
1420
  @pattern_cc_1 << @_attrValue1 << TAG_SEARCH_2_6 << @_attrName2 << ATTR_EQ
1421
1421
  @pattern_cc_1 << @_attrValue2 << TAG_SEARCH_2_7 << @_attrName2 << ATTR_EQ
@@ -1445,7 +1445,9 @@ module Meteor
1445
1445
 
1446
1446
  @pattern_2 = Meteor::Core::Util::PatternCache.get(@pattern_cc_2)
1447
1447
  @pattern_1b = Meteor::Core::Util::PatternCache.get(@pattern_cc_1b);
1448
-
1448
+
1449
+ @cnt = 0
1450
+
1449
1451
  create_element_pattern
1450
1452
 
1451
1453
  @pattern_cc = @sbuf
@@ -1787,7 +1789,9 @@ module Meteor
1787
1789
  end
1788
1790
  #属性の置換
1789
1791
  @pattern = Meteor::Core::Util::PatternCache.get('' << attrName << SET_ATTR_1)
1790
- elm.attributes.sub!(@pattern,'' << attrName << ATTR_EQ << @_attrValue << DOUBLE_QUATATION)
1792
+
1793
+ #elm.attributes.sub!(@pattern,'' << attrName << ATTR_EQ << @_attrValue << DOUBLE_QUATATION)
1794
+ elm.attributes.sub!(@pattern,"#{attrName}=\"#{@_attrValue}\"")
1791
1795
  else
1792
1796
  #属性文字列の最後に新規の属性を追加する
1793
1797
  @_attrValue = attrValue
@@ -1849,9 +1853,9 @@ module Meteor
1849
1853
  @pattern = Meteor::Core::Util::PatternCache.get(elm.pattern)
1850
1854
 
1851
1855
  #タグ置換
1852
- @pattern_cc = '' << SET_CX_1 << elm.name << SPACE << elm.attributes << SET_CX_2
1853
- @pattern_cc << @_content << SET_CX_3 << elm.name << SET_CX_4
1854
- #@pattern_cc = "<!-- @#{elm.name} #{elm.attributes}-->#{@_content}<!-- /@#{elm.name} -->"
1856
+ #@pattern_cc = '' << SET_CX_1 << elm.name << SPACE << elm.attributes << SET_CX_2
1857
+ #@pattern_cc << @_content << SET_CX_3 << elm.name << SET_CX_4
1858
+ @pattern_cc = "<!-- @#{elm.name} #{elm.attributes}-->#{@_content}<!-- /@#{elm.name} -->"
1855
1859
  @root.document.sub!(@pattern,@pattern_cc)
1856
1860
  end
1857
1861
  end
@@ -1864,11 +1868,11 @@ module Meteor
1864
1868
  if attr.changed then
1865
1869
  @_attrValue = escapeRegex(attr.value)
1866
1870
  #replace2Regex(@_attrValue)
1867
- @pattern_cc = '' << name << SET_ATTR_1
1868
- #@pattern_cc = "#{attrName}=\"[^\"]*\""
1871
+ #@pattern_cc = '' << name << SET_ATTR_1
1872
+ @pattern_cc = "#{attrName}=\"[^\"]*\""
1869
1873
  @pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
1870
- elm.pattern.gsub!(@pattern,'' << name << ATTR_EQ << @_attrValue << DOUBLE_QUATATION)
1871
- #elm.pattern.sub!(@pattern,"#{attrName}=\"#{@_attrValue}\"")
1874
+ #elm.pattern.gsub!(@pattern,'' << name << ATTR_EQ << @_attrValue << DOUBLE_QUATATION)
1875
+ elm.pattern.sub!(@pattern,"#{attrName}=\"#{@_attrValue}\"")
1872
1876
  elsif attr.removed then
1873
1877
  @pattern_cc = '' << name << SET_ATTR_1
1874
1878
  #@pattern_cc = "#{attrName}=\"[^\"]*\""
@@ -2747,10 +2751,10 @@ module Meteor
2747
2751
  #
2748
2752
  class ParserImpl < Meteor::Core::Kernel
2749
2753
 
2750
- KAIGYO_CODE = "(\r?\n|\r)"
2754
+ KAIGYO_CODE = '(\r?\n|\r)'
2751
2755
  NBSP_2 = '&nbsp;'
2752
- BR_1 = "\r?\n|\r"
2753
- BR_2 = "<br>"
2756
+ BR_1 = '\r?\n|\r'
2757
+ BR_2 = '<br>'
2754
2758
 
2755
2759
  META = 'META'
2756
2760
  META_S = 'meta'
@@ -2793,21 +2797,21 @@ module Meteor
2793
2797
  #@@pattern_select = Regexp.new(SELECT)
2794
2798
  #@@pattern_multiple = Regexp.new(MULTIPLE)
2795
2799
 
2796
- SELECTED_M = "\\sselected\\s|\\sselected$|\\sSELECTED\\s|\\sSELECTED$"
2800
+ SELECTED_M = '\\sselected\\s|\\sselected$|\\sSELECTED\\s|\\sSELECTED$'
2797
2801
  #SELECTED_M = [' selected ',' selected',' SELECTED ',' SELECTED']
2798
- SELECTED_R = "selected\\s|selected$|SELECTED\\s|SELECTED$"
2799
- CHECKED_M = "\\schecked\\s|\\schecked$|\\sCHECKED\\s|\\sCHECKED$"
2802
+ SELECTED_R = 'selected\\s|selected$|SELECTED\\s|SELECTED$'
2803
+ CHECKED_M = '\\schecked\\s|\\schecked$|\\sCHECKED\\s|\\sCHECKED$'
2800
2804
  #CHECKED_M = [' checked ',' checked',' CHECKED ',' CHECKED']
2801
- CHECKED_R = "checked\\s|checked$|CHECKED\\s|CHECKED$"
2802
- DISABLED_M = "\\sdisabled\\s|\\sdisabled$|\\sDISABLED\\s|\\sDISABLED$"
2805
+ CHECKED_R = 'checked\\s|checked$|CHECKED\\s|CHECKED$'
2806
+ DISABLED_M = '\\sdisabled\\s|\\sdisabled$|\\sDISABLED\\s|\\sDISABLED$'
2803
2807
  #DISABLED_M = [' disabled ',' disiabled',' DISABLED ',' DISABLED']
2804
- DISABLED_R = "disabled\\s|disabled$|DISABLED\\s|DISABLED$"
2805
- READONLY_M = "\\sreadonly\\s|\\sreadonly$|\\sREADONLY\\s|\\sREADONLY$"
2808
+ DISABLED_R = 'disabled\\s|disabled$|DISABLED\\s|DISABLED$'
2809
+ READONLY_M = '\\sreadonly\\s|\\sreadonly$|\\sREADONLY\\s|\\sREADONLY$'
2806
2810
  #READONLY_M = [' readonly ',' readonly',' READONLY ',' READONLY']
2807
- READONLY_R = "readonly\\s|readonly$|READONLY\\s|READONLY$"
2808
- MULTIPLE_M = "\\smultiple\\s|\\smultiple$|\\sMULTIPLE\\s|\\sMULTIPLE$"
2811
+ READONLY_R = 'readonly\\s|readonly$|READONLY\\s|READONLY$'
2812
+ MULTIPLE_M = '\\smultiple\\s|\\smultiple$|\\sMULTIPLE\\s|\\sMULTIPLE$'
2809
2813
  #MULTIPLE_M = [' multiple ',' multiple',' MULTIPLE ',' MULTIPLE']
2810
- MULTIPLE_R = "multiple\\s|multiple$|MULTIPLE\\s|MULTIPLE$"
2814
+ MULTIPLE_R = 'multiple\\s|multiple$|MULTIPLE\\s|MULTIPLE$'
2811
2815
 
2812
2816
  @@pattern_selected_m = Regexp.new(SELECTED_M)
2813
2817
  @@pattern_selected_r = Regexp.new(SELECTED_R)
@@ -2877,7 +2881,7 @@ module Meteor
2877
2881
  @@pattern_set_mono1 = Regexp.new(SET_MONO_1)
2878
2882
  #@@pattern_match_tag2 = Regexp.new(MATCH_TAG_2)
2879
2883
 
2880
- GET_ATTRS_MAP2="\\s(disabled|readonly|checked|selected|multiple)"
2884
+ GET_ATTRS_MAP2='\\s(disabled|readonly|checked|selected|multiple)'
2881
2885
  @@pattern_get_attrs_map2 = Regexp.new(GET_ATTRS_MAP2)
2882
2886
 
2883
2887
  #
@@ -3499,11 +3503,11 @@ module Meteor
3499
3503
  #
3500
3504
  class ParserImpl < Meteor::Core::Kernel
3501
3505
 
3502
- KAIGYO_CODE = "(\r?\n|\r)"
3506
+ KAIGYO_CODE = '(\r?\n|\r)'
3503
3507
  NBSP_2 = '&nbsp;'
3504
- BR_1 = "\r?\n|\r"
3508
+ BR_1 = '\r?\n|\r'
3505
3509
  BR_2 = '<br/>'
3506
- BR_3 = "<br\\/>"
3510
+ BR_3 = '<br\\/>'
3507
3511
 
3508
3512
  META = 'META'
3509
3513
  META_S = 'meta'
@@ -3540,26 +3544,26 @@ module Meteor
3540
3544
  #@@pattern_select = Regexp.new(SELECT)
3541
3545
  #@@pattern_multiple = Regexp.new(MULTIPLE)
3542
3546
 
3543
- SELECTED_M = "\\sselected=\"[^\"]*\"\\s|\\sselected=\"[^\"]*\"$"
3544
- SELECTED_M1 = "\\sselected=\"([^\"]*)\"\\s|\\sselected=\"([^\"]*)\"$"
3545
- SELECTED_R = "selected=\"[^\"]*\""
3546
- SELECTED_U = "selected=\"selected\""
3547
- CHECKED_M = "\\schecked=\"[^\"]*\"\\s|\\schecked=\"[^\"]*\"$"
3548
- CHECKED_M1 = "\\schecked=\"([^\"]*)\"\\s|\\schecked=\"([^\"]*)\"$"
3549
- CHECKED_R = "checked=\"[^\"]*\""
3550
- CHECKED_U = "checked=\"checked\""
3551
- DISABLED_M = "\\sdisabled=\"[^\"]*\"\\s|\\sdisabled=\"[^\"]*\"$"
3552
- DISABLED_M1 = "\\sdisabled=\"([^\"]*)\"\\s|\\sdisabled=\"([^\"]*)\"$"
3553
- DISABLED_R = "disabled=\"[^\"]*\""
3554
- DISABLED_U = "disabled=\"disabled\""
3555
- READONLY_M = "\\sreadonly=\"[^\"]*\"\\s|\\sreadonly=\"[^\"]*\"$"
3556
- READONLY_M1 = "\\sreadonly=\"([^\"]*)\"\\s|\\sreadonly=\"([^\"]*)\"$"
3557
- READONLY_R = "readonly=\"[^\"]*\""
3558
- READONLY_U = "readonly=\"readonly\""
3559
- MULTIPLE_M = "\\smultiple=\"[^\"]*\"\\s|\\smultiple=\"[^\"]*\"$"
3560
- MULTIPLE_M1 = "\\smultiple=\"([^\"]*)\"\\s|\\smultiple=\"([^\"]*)\"$"
3561
- MULTIPLE_R = "multiple=\"[^\"]*\""
3562
- MULTIPLE_U = "multiple=\"multiple\""
3547
+ SELECTED_M = '\\sselected="[^"]*"\\s|\\sselected="[^"]*"$'
3548
+ SELECTED_M1 = '\\sselected="([^"]*)"\\s|\\sselected="([^"]*)"$'
3549
+ SELECTED_R = 'selected="[^"]*"'
3550
+ SELECTED_U = 'selected="selected"'
3551
+ CHECKED_M = '\\schecked="[^"]*"\\s|\\schecked="[^"]*"$'
3552
+ CHECKED_M1 = '\\schecked="([^"]*)"\\s|\\schecked="([^"]*)"$'
3553
+ CHECKED_R = 'checked="[^"]*"'
3554
+ CHECKED_U = 'checked="checked"'
3555
+ DISABLED_M = '\\sdisabled="[^"]*"\\s|\\sdisabled="[^"]*"$'
3556
+ DISABLED_M1 = '\\sdisabled="([^"]*)"\\s|\\sdisabled="([^"]*)"$'
3557
+ DISABLED_R = 'disabled="[^"]*"'
3558
+ DISABLED_U = 'disabled="disabled"'
3559
+ READONLY_M = '\\sreadonly="[^"]*"\\s|\\sreadonly="[^"]*"$'
3560
+ READONLY_M1 = '\\sreadonly="([^"]*)"\\s|\\sreadonly="([^"]*)"$'
3561
+ READONLY_R = 'readonly="[^"]*"'
3562
+ READONLY_U = 'readonly="readonly"'
3563
+ MULTIPLE_M = '\\smultiple="[^"]*"\\s|\\smultiple="[^"]*"$'
3564
+ MULTIPLE_M1 = '\\smultiple="([^"]*)"\\s|\\smultiple="([^"]*)"$'
3565
+ MULTIPLE_R = 'multiple="[^"]*"'
3566
+ MULTIPLE_U = 'multiple="multiple"'
3563
3567
 
3564
3568
  HTTP_EQUIV = 'http-equiv'
3565
3569
  CONTENT_TYPE = 'Content-Type'
@@ -3607,8 +3611,8 @@ module Meteor
3607
3611
  "\n" => '<br/>',
3608
3612
  }
3609
3613
 
3610
- PATTERN_ESCAPE = "[&\"'<> ]"
3611
- PATTERN_ESCAPE_CONTENT = "[&\"'<> \\n]"
3614
+ PATTERN_ESCAPE = '[&"\'<> ]'
3615
+ PATTERN_ESCAPE_CONTENT = '[&"\'<> \\n]'
3612
3616
  @@pattern_escape = Regexp.new(PATTERN_ESCAPE)
3613
3617
  @@pattern_escape_content = Regexp.new(PATTERN_ESCAPE_CONTENT)
3614
3618
 
@@ -4022,7 +4026,7 @@ module Meteor
4022
4026
  '>' => '&gt;',
4023
4027
  }
4024
4028
 
4025
- PATTERN_ESCAPE = "[&\"'<>]"
4029
+ PATTERN_ESCAPE = '[&\"\'<>]'
4026
4030
  PATTERN_UNESCAPE = '&(amp|quot|apos|gt|lt);'
4027
4031
 
4028
4032
  @@pattern_and_1 = Regexp.new(AND_1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asip-meteor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.6
4
+ version: 0.9.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - asip