asip-meteor 0.9.1.7 → 0.9.1.8
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.
- data/lib/meteor.rb +57 -43
- metadata +2 -2
    
        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.1. | 
| 21 | 
            +
            # @version 0.9.1.8
         | 
| 22 22 | 
             
            #
         | 
| 23 23 |  | 
| 24 24 |  | 
| @@ -31,7 +31,7 @@ end | |
| 31 31 |  | 
| 32 32 | 
             
            module Meteor
         | 
| 33 33 |  | 
| 34 | 
            -
              VERSION = "0.9.1. | 
| 34 | 
            +
              VERSION = "0.9.1.8"
         | 
| 35 35 |  | 
| 36 36 | 
             
              ZERO = 0
         | 
| 37 37 | 
             
              ONE = 1
         | 
| @@ -85,7 +85,7 @@ module Meteor | |
| 85 85 | 
             
                  #@parent = false
         | 
| 86 86 | 
             
                  @arguments = AttributeMap.new
         | 
| 87 87 | 
             
                  #@origin = self.object_id
         | 
| 88 | 
            -
                  @usable = ZERO | 
| 88 | 
            +
                  @usable = ZERO
         | 
| 89 89 | 
             
                end
         | 
| 90 90 | 
             
                private :initialize_s
         | 
| 91 91 |  | 
| @@ -144,7 +144,7 @@ module Meteor | |
| 144 144 | 
             
                attr_accessor :arguments
         | 
| 145 145 | 
             
                attr_accessor :usable
         | 
| 146 146 | 
             
                #attr_accessor :origin
         | 
| 147 | 
            -
             | 
| 147 | 
            +
             | 
| 148 148 | 
             
                #
         | 
| 149 149 | 
             
                # 属性を編集する or 属性の値を取得する
         | 
| 150 150 | 
             
                # 
         | 
| @@ -277,7 +277,7 @@ module Meteor | |
| 277 277 | 
             
              # 属性マップクラス
         | 
| 278 278 | 
             
              #
         | 
| 279 279 | 
             
              class AttributeMap
         | 
| 280 | 
            -
             | 
| 280 | 
            +
             | 
| 281 281 | 
             
                def initialize(*args)
         | 
| 282 282 | 
             
                  case args.length
         | 
| 283 283 | 
             
                  when ZERO
         | 
| @@ -385,7 +385,7 @@ module Meteor | |
| 385 385 | 
             
                #
         | 
| 386 386 | 
             
                # 属性名で属性の変更状況を取得する
         | 
| 387 387 | 
             
                # 
         | 
| 388 | 
            -
                # @return [TrueClass | 
| 388 | 
            +
                # @return [TrueClass,FalseClass] 属性の変更状況
         | 
| 389 389 | 
             
                #
         | 
| 390 390 | 
             
                def changed(name)
         | 
| 391 391 | 
             
                  if @map[name] then
         | 
| @@ -396,14 +396,14 @@ module Meteor | |
| 396 396 | 
             
                #
         | 
| 397 397 | 
             
                # 属性名で属性の削除状況を取得する
         | 
| 398 398 | 
             
                # 
         | 
| 399 | 
            -
                # @return [TrueClass | 
| 399 | 
            +
                # @return [TrueClass,FalseClass] 属性の削除状況
         | 
| 400 400 | 
             
                #
         | 
| 401 401 | 
             
                def removed(name)
         | 
| 402 402 | 
             
                  if @map[name] then
         | 
| 403 403 | 
             
                    @map[name].removed
         | 
| 404 404 | 
             
                  end
         | 
| 405 405 | 
             
                end
         | 
| 406 | 
            -
             | 
| 406 | 
            +
             | 
| 407 407 | 
             
                attr_accessor :map
         | 
| 408 408 | 
             
                attr_accessor :recordable
         | 
| 409 409 |  | 
| @@ -604,24 +604,31 @@ module Meteor | |
| 604 604 | 
             
                  def initialize
         | 
| 605 605 | 
             
                  end
         | 
| 606 606 |  | 
| 607 | 
            -
                  def do_action(elm, | 
| 607 | 
            +
                  def do_action(elm,ps,list)
         | 
| 608 608 | 
             
                    #内容あり要素の場合
         | 
| 609 609 | 
             
                    if elm.empty then
         | 
| 610 | 
            -
                      pif2 =  | 
| 611 | 
            -
             | 
| 610 | 
            +
                      pif2 = ps.child(elm)
         | 
| 611 | 
            +
                      init(pif2)
         | 
| 612 612 | 
             
                      list.each do |item|
         | 
| 613 613 | 
             
                        if pif2.root_element.hook then
         | 
| 614 614 | 
             
                          pif2.root_element.document = elm.mixed_content
         | 
| 615 615 | 
             
                          #elsif pif2.rootElement.mono_hook then
         | 
| 616 616 | 
             
                        end
         | 
| 617 | 
            -
                        execute(pif2, item)
         | 
| 617 | 
            +
                        execute(pif2.root_element.mutable_element, item)
         | 
| 618 | 
            +
                        pif2.print
         | 
| 618 619 | 
             
                      end
         | 
| 619 620 | 
             
                      pif2.flush
         | 
| 620 621 | 
             
                    end
         | 
| 621 622 | 
             
                  end
         | 
| 622 623 |  | 
| 623 | 
            -
                  def  | 
| 624 | 
            +
                  def init(ps)
         | 
| 625 | 
            +
                  end
         | 
| 626 | 
            +
                  private :init
         | 
| 627 | 
            +
             | 
| 628 | 
            +
                  def execute(elm,item)
         | 
| 624 629 | 
             
                  end
         | 
| 630 | 
            +
                  private :execute
         | 
| 631 | 
            +
                  
         | 
| 625 632 | 
             
                end
         | 
| 626 633 | 
             
              end
         | 
| 627 634 |  | 
| @@ -898,14 +905,13 @@ module Meteor | |
| 898 905 | 
             
                  def document
         | 
| 899 906 | 
             
                    @root.document
         | 
| 900 907 | 
             
                  end
         | 
| 901 | 
            -
             | 
| 902 | 
            -
                  attr_accessor :parent
         | 
| 908 | 
            +
               
         | 
| 903 909 | 
             
                  attr_accessor :e_cache
         | 
| 904 910 |  | 
| 905 911 | 
             
                  #
         | 
| 906 912 | 
             
                  # フックフラグをセットする
         | 
| 907 913 | 
             
                  # 
         | 
| 908 | 
            -
                  # @param [TrueClass | 
| 914 | 
            +
                  # @param [TrueClass,FalseClass] hook フックフラグ
         | 
| 909 915 | 
             
                  #
         | 
| 910 916 | 
             
                  #def hook=(hook)
         | 
| 911 917 | 
             
                  #  @root.hook = hook
         | 
| @@ -914,7 +920,7 @@ module Meteor | |
| 914 920 | 
             
                  #
         | 
| 915 921 | 
             
                  # フックフラグを取得する
         | 
| 916 922 | 
             
                  # 
         | 
| 917 | 
            -
                  # @return [TrueClass | 
| 923 | 
            +
                  # @return [TrueClass,FalseClass] フックフラグ
         | 
| 918 924 | 
             
                  #
         | 
| 919 925 | 
             
                  #def hook
         | 
| 920 926 | 
             
                  #  @root.hook
         | 
| @@ -923,7 +929,7 @@ module Meteor | |
| 923 929 | 
             
                  #
         | 
| 924 930 | 
             
                  # 単一要素フックフラグをセットする
         | 
| 925 931 | 
             
                  # 
         | 
| 926 | 
            -
                  # @pamam [TrueClass | 
| 932 | 
            +
                  # @pamam [TrueClass,FalseClass] hook 単一要素フックフラグ
         | 
| 927 933 | 
             
                  #
         | 
| 928 934 | 
             
                  #def mono_hook=(hook)
         | 
| 929 935 | 
             
                  #  @root.mono_hook = hook
         | 
| @@ -932,7 +938,7 @@ module Meteor | |
| 932 938 | 
             
                  #
         | 
| 933 939 | 
             
                  # 単一要素フックフラグを取得する
         | 
| 934 940 | 
             
                  # 
         | 
| 935 | 
            -
                  # @return [TrueClass | 
| 941 | 
            +
                  # @return [TrueClass,FalseClass] 単一要素フックフラグ
         | 
| 936 942 | 
             
                  #
         | 
| 937 943 | 
             
                  #def mono_hook
         | 
| 938 944 | 
             
                  #  @root.mono_hook
         | 
| @@ -1098,20 +1104,20 @@ module Meteor | |
| 1098 1104 | 
             
                      if @res1.end(0) < @res2.end(0) then
         | 
| 1099 1105 | 
             
                        @res = @res1
         | 
| 1100 1106 | 
             
                        @pattern_cc = @pattern_cc_1
         | 
| 1101 | 
            -
                         | 
| 1107 | 
            +
                        element_without_1(elm_name)
         | 
| 1102 1108 | 
             
                      elsif @res1.end(0) > @res2.end(0)
         | 
| 1103 1109 | 
             
                        @res = @res2
         | 
| 1104 1110 | 
             
                        @pattern_cc = @pattern_cc_2
         | 
| 1105 | 
            -
                         | 
| 1111 | 
            +
                        element_with_1(elm_name)
         | 
| 1106 1112 | 
             
                      end
         | 
| 1107 1113 | 
             
                    elsif @res1 && !@res2 then
         | 
| 1108 1114 | 
             
                      @res = @res1
         | 
| 1109 1115 | 
             
                      @pattern_cc = @pattern_cc_1
         | 
| 1110 | 
            -
                       | 
| 1116 | 
            +
                      element_without_1(elm_name)
         | 
| 1111 1117 | 
             
                    elsif !@res1 && @res2 then
         | 
| 1112 1118 | 
             
                      @res = @res2
         | 
| 1113 1119 | 
             
                      @pattern_cc = @pattern_cc_2
         | 
| 1114 | 
            -
                       | 
| 1120 | 
            +
                      element_with_1(elm_name)
         | 
| 1115 1121 | 
             
                    elsif !@res1 && !@res2 then
         | 
| 1116 1122 | 
             
                      @elm_ = nil
         | 
| 1117 1123 | 
             
                      #raise NoSuchElementException.new(elm_name);
         | 
| @@ -1369,7 +1375,8 @@ module Meteor | |
| 1369 1375 | 
             
                    @res = @pattern.match(@root.document)
         | 
| 1370 1376 |  | 
| 1371 1377 | 
             
                    if @res then
         | 
| 1372 | 
            -
                       | 
| 1378 | 
            +
                      #@elm_ = element_3(@res[1], attr_name, attr_value)
         | 
| 1379 | 
            +
                      element_3(@res[1], attr_name, attr_value)
         | 
| 1373 1380 | 
             
                    else
         | 
| 1374 1381 | 
             
                      @elm_ = nil
         | 
| 1375 1382 | 
             
                    end
         | 
| @@ -1614,7 +1621,8 @@ module Meteor | |
| 1614 1621 | 
             
                    @res = @pattern.match(@root.document)
         | 
| 1615 1622 |  | 
| 1616 1623 | 
             
                    if @res then
         | 
| 1617 | 
            -
                       | 
| 1624 | 
            +
                      #@elm_ = element_5(@res[1], attr_name1, attr_value1,attr_name2, attr_value2);
         | 
| 1625 | 
            +
                      element_5(@res[1], attr_name1, attr_value1,attr_name2, attr_value2);
         | 
| 1618 1626 | 
             
                    else
         | 
| 1619 1627 | 
             
                      @elm_ = nil
         | 
| 1620 1628 | 
             
                    end
         | 
| @@ -2143,8 +2151,8 @@ module Meteor | |
| 2143 2151 | 
             
                  # 要素の内容をセットする
         | 
| 2144 2152 | 
             
                  #
         | 
| 2145 2153 | 
             
                  # @param [Meteor::Element] elm 要素
         | 
| 2146 | 
            -
                  # @param [String]  | 
| 2147 | 
            -
                  # @param [TrueClass | 
| 2154 | 
            +
                  # @param [String] content 要素の内容
         | 
| 2155 | 
            +
                  # @param [TrueClass,FalseClass] entityRef エンティティ参照フラグ
         | 
| 2148 2156 | 
             
                  #
         | 
| 2149 2157 | 
             
                  def set_content_3(elm,content,entity_ref=true)
         | 
| 2150 2158 |  | 
| @@ -2165,8 +2173,8 @@ module Meteor | |
| 2165 2173 | 
             
                  #
         | 
| 2166 2174 | 
             
                  # 要素の内容を編集する
         | 
| 2167 2175 | 
             
                  # 
         | 
| 2168 | 
            -
                  # @param [Meteor::Element] 要素
         | 
| 2169 | 
            -
                  # @param [String]  | 
| 2176 | 
            +
                  # @param [Meteor::Element] elm 要素
         | 
| 2177 | 
            +
                  # @param [String] content 要素の内容
         | 
| 2170 2178 | 
             
                  #
         | 
| 2171 2179 | 
             
                  def set_content_2_s(elm,content)
         | 
| 2172 2180 | 
             
                    set_content_3(elm, content)
         | 
| @@ -2176,7 +2184,7 @@ module Meteor | |
| 2176 2184 | 
             
                  #
         | 
| 2177 2185 | 
             
                  # 要素の内容を編集する
         | 
| 2178 2186 | 
             
                  # 
         | 
| 2179 | 
            -
                  # @param [String]  | 
| 2187 | 
            +
                  # @param [String] content 内容
         | 
| 2180 2188 | 
             
                  #
         | 
| 2181 2189 | 
             
                  def set_content_1(content)
         | 
| 2182 2190 | 
             
                    if @root.mono_hook then
         | 
| @@ -2188,8 +2196,8 @@ module Meteor | |
| 2188 2196 | 
             
                  #
         | 
| 2189 2197 | 
             
                  # 要素の内容を編集する
         | 
| 2190 2198 | 
             
                  # 
         | 
| 2191 | 
            -
                  # @param [String]  | 
| 2192 | 
            -
                  # @param [TrueClass | 
| 2199 | 
            +
                  # @param [String] content 内容
         | 
| 2200 | 
            +
                  # @param [TrueClass,FalseClass] entity_ref エンティティ参照フラグ
         | 
| 2193 2201 | 
             
                  #
         | 
| 2194 2202 | 
             
                  def set_content_2_b(content,entity_ref)
         | 
| 2195 2203 | 
             
                    if @root.mono_hook then
         | 
| @@ -2359,7 +2367,8 @@ module Meteor | |
| 2359 2367 | 
             
                    @res = @pattern.match(@root.document)
         | 
| 2360 2368 |  | 
| 2361 2369 | 
             
                    if @res then
         | 
| 2362 | 
            -
                       | 
| 2370 | 
            +
                      #@elm_ = cxtag(@res[1],id)
         | 
| 2371 | 
            +
                      cxtag(@res[1],id)
         | 
| 2363 2372 | 
             
                    else
         | 
| 2364 2373 | 
             
                      @elm_ = nil
         | 
| 2365 2374 | 
             
                    end
         | 
| @@ -2435,7 +2444,7 @@ module Meteor | |
| 2435 2444 | 
             
                          #@root.hookDocument << TAG_OPEN3 << @root.mutableElement.name << TAG_CLOSE
         | 
| 2436 2445 | 
             
                          @root.hook_document << "<#{@root.mutableElement.name}#{@root.mutableElement.attributes}>#{@root.mutableElement.mixed_content}</#{@root.mutableElement.name}>"
         | 
| 2437 2446 | 
             
                        end
         | 
| 2438 | 
            -
                        @root.mutableElement = Element. | 
| 2447 | 
            +
                        @root.mutableElement = Element.new!(@root.element)
         | 
| 2439 2448 | 
             
                      else
         | 
| 2440 2449 | 
             
                        #フック判定がFALSEの場合
         | 
| 2441 2450 | 
             
                        clean
         | 
| @@ -2450,7 +2459,7 @@ module Meteor | |
| 2450 2459 | 
             
                    #CX終了タグ置換
         | 
| 2451 2460 | 
             
                    @pattern = @@pattern_clean2
         | 
| 2452 2461 | 
             
                    @root.document.gsub!(@pattern,EMPTY)
         | 
| 2453 | 
            -
                    #@root.document  | 
| 2462 | 
            +
                    #@root.document << "<!-- Powered by Meteor (C)Yasumasa Ashida -->"
         | 
| 2454 2463 | 
             
                  end
         | 
| 2455 2464 | 
             
                  private :clean
         | 
| 2456 2465 |  | 
| @@ -2468,7 +2477,6 @@ module Meteor | |
| 2468 2477 | 
             
                      pif2 = create(self)
         | 
| 2469 2478 |  | 
| 2470 2479 | 
             
                      elm.parent=true
         | 
| 2471 | 
            -
                      pif2.parent = self
         | 
| 2472 2480 | 
             
                      pif2.root_element.element = elm
         | 
| 2473 2481 | 
             
                      pif2.root_element.mutableElement = Element.new(elm)
         | 
| 2474 2482 | 
             
                      pif2.root_element.kaigyo_code = @root.kaigyo_code
         | 
| @@ -3073,10 +3081,12 @@ module Meteor | |
| 3073 3081 | 
             
                    # ドキュメントをパースし、コンテントタイプをセットする
         | 
| 3074 3082 | 
             
                    #
         | 
| 3075 3083 | 
             
                    def analyze_content_type
         | 
| 3076 | 
            -
                       | 
| 3084 | 
            +
                      #@elm_ = element(META_S,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3085 | 
            +
                      element(META_S,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3077 3086 |  | 
| 3078 3087 | 
             
                      if !@elm_ then
         | 
| 3079 | 
            -
                         | 
| 3088 | 
            +
                        #@elm_ = element(META,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3089 | 
            +
                        element(META,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3080 3090 | 
             
                      end
         | 
| 3081 3091 |  | 
| 3082 3092 | 
             
                      if @elm_ then
         | 
| @@ -3238,7 +3248,8 @@ module Meteor | |
| 3238 3248 | 
             
                      @res = @pattern.match(@root.document)
         | 
| 3239 3249 |  | 
| 3240 3250 | 
             
                      if @res then
         | 
| 3241 | 
            -
                         | 
| 3251 | 
            +
                        #@elm_ = element_3(@res[1],attr_name,attr_value)
         | 
| 3252 | 
            +
                        element_3(@res[1],attr_name,attr_value)
         | 
| 3242 3253 | 
             
                      else
         | 
| 3243 3254 | 
             
                        @elm_ = nil
         | 
| 3244 3255 | 
             
                      end
         | 
| @@ -3351,7 +3362,8 @@ module Meteor | |
| 3351 3362 | 
             
                      @res = @pattern.match(@root.document)
         | 
| 3352 3363 |  | 
| 3353 3364 | 
             
                      if @res then
         | 
| 3354 | 
            -
                         | 
| 3365 | 
            +
                        #@elm_ = element_5(@res[1],attr_name1,attr_value1,attr_name2,attr_value2)
         | 
| 3366 | 
            +
                        element_5(@res[1],attr_name1,attr_value1,attr_name2,attr_value2)
         | 
| 3355 3367 | 
             
                      else
         | 
| 3356 3368 | 
             
                        @elm_ = nil
         | 
| 3357 3369 | 
             
                      end
         | 
| @@ -3831,7 +3843,7 @@ module Meteor | |
| 3831 3843 | 
             
                    # ドキュメントをパースする
         | 
| 3832 3844 | 
             
                    #
         | 
| 3833 3845 | 
             
                    def analyze_ml()
         | 
| 3834 | 
            -
                      # | 
| 3846 | 
            +
                      #content-typeの取得
         | 
| 3835 3847 | 
             
                      analyze_content_type
         | 
| 3836 3848 | 
             
                      #改行コードの取得
         | 
| 3837 3849 | 
             
                      analyze_kaigyo_code
         | 
| @@ -3852,10 +3864,12 @@ module Meteor | |
| 3852 3864 | 
             
                    # ドキュメントをパースし、コンテントタイプをセットする
         | 
| 3853 3865 | 
             
                    #
         | 
| 3854 3866 | 
             
                    def analyze_content_type
         | 
| 3855 | 
            -
                       | 
| 3867 | 
            +
                      #@elm_ = element(META_S,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3868 | 
            +
                      element(META_S,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3856 3869 |  | 
| 3857 3870 | 
             
                      if !@elm_ then
         | 
| 3858 | 
            -
                         | 
| 3871 | 
            +
                        #@elm_ = element(META,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3872 | 
            +
                        element(META,HTTP_EQUIV,CONTENT_TYPE)
         | 
| 3859 3873 | 
             
                      end
         | 
| 3860 3874 |  | 
| 3861 3875 | 
             
                      if @elm_ then
         | 
    
        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.1. | 
| 4 | 
            +
              version: 0.9.1.8
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 7 | 
             
            - asip
         | 
| @@ -9,7 +9,7 @@ autorequire: meteor | |
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 11 |  | 
| 12 | 
            -
            date: 2009-05- | 
| 12 | 
            +
            date: 2009-05-27 00:00:00 -07:00
         | 
| 13 13 | 
             
            default_executable: 
         | 
| 14 14 | 
             
            dependencies: []
         | 
| 15 15 |  |