asip-meteor 0.9.0 → 0.9.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/ChangeLog +1 -1
  2. data/lib/meteor.rb +57 -52
  3. metadata +2 -2
data/ChangeLog CHANGED
@@ -1,4 +1,4 @@
1
- == 0.0.1 / 2008-09-03
1
+ == 0.9.0.1 / 2008-10-03 Yasumasa Ashida <ys.ashida@gmail.com>
2
2
 
3
3
  * initial release
4
4
 
data/lib/meteor.rb CHANGED
@@ -836,54 +836,54 @@ module Meteor
836
836
  #
837
837
  # @param [TrueClass][FalseClass] hook フックフラグ
838
838
  #
839
- def hook=(hook)
840
- @root.hook = hook
841
- end
839
+ #def hook=(hook)
840
+ # @root.hook = hook
841
+ #end
842
842
 
843
843
  #
844
844
  # フックフラグを取得する
845
845
  #
846
846
  # @return [TrueClass][FalseClass] フックフラグ
847
847
  #
848
- def hook
849
- @root.hook
850
- end
848
+ #def hook
849
+ # @root.hook
850
+ #end
851
851
 
852
852
  #
853
853
  # 単一要素フックフラグをセットする
854
854
  #
855
855
  # @pamam [TrueClass][FalseClass] hook 単一要素フックフラグ
856
856
  #
857
- def monoHook=(hook)
858
- @root.monoHook = hook
859
- end
857
+ #def monoHook=(hook)
858
+ # @root.monoHook = hook
859
+ #end
860
860
 
861
861
  #
862
862
  # 単一要素フックフラグを取得する
863
863
  #
864
864
  # @return [TrueClass][FalseClass] 単一要素フックフラグ
865
865
  #
866
- def monoHook
867
- @root.monoHook
868
- end
866
+ #def monoHook
867
+ # @root.monoHook
868
+ #end
869
869
 
870
870
  #
871
871
  # フックドキュメントをセットする
872
872
  #
873
873
  # @param [String] hookDocument フックドキュメント
874
874
  #
875
- def hookDocument=(hookDocument)
876
- @root.hookDocument = hookDocument
877
- end
875
+ #def hookDocument=(hookDocument)
876
+ # @root.hookDocument = hookDocument
877
+ #end
878
878
 
879
879
  #
880
880
  # フックドキュメントを取得する
881
881
  #
882
882
  # @return [String] フックドキュメント
883
883
  #
884
- def hookDocument
885
- @root.hookDocument
886
- end
884
+ #def hookDocument
885
+ # @root.hookDocument
886
+ #end
887
887
 
888
888
  #
889
889
  # 文字エンコーディングをセットする
@@ -1946,15 +1946,14 @@ module Meteor
1946
1946
 
1947
1947
  def editAttributes_(elm,attrName,attrValue)
1948
1948
 
1949
- attrValue = escape(attrValue)
1950
-
1951
- @pattern = Meteor::Core::Util::PatternCache.get('' << attrName << SET_ATTR_1)
1949
+ #attrValue = escape(attrValue)
1952
1950
 
1953
1951
  #属性検索
1954
- @res = @pattern.match(elm.attributes)
1952
+ #@res = @pattern.match(elm.attributes)
1955
1953
 
1956
1954
  #検索対象属性の存在判定
1957
- if @res then
1955
+ #if @res then
1956
+ if elm.attributes.include?(' ' << attrName << ATTR_EQ) then
1958
1957
 
1959
1958
  @_attrValue = attrValue
1960
1959
  #replace2Regex(@_attrValue)
@@ -1964,16 +1963,23 @@ module Meteor
1964
1963
  replace2Regex(@_attrValue)
1965
1964
  end
1966
1965
  #属性の置換
1966
+ @pattern = Meteor::Core::Util::PatternCache.get('' << attrName << SET_ATTR_1)
1967
1967
  elm.attributes.sub!(@pattern,'' << attrName << ATTR_EQ << @_attrValue << DOUBLE_QUATATION)
1968
1968
  else
1969
1969
  #属性文字列の最後に新規の属性を追加する
1970
+ @_attrValue = attrValue
1971
+ #replace2Regex(@_attrValue)
1972
+ if elm.parser.rootElement.hook || elm.parser.rootElement.monoHook then
1973
+ replace2Regex(@_attrValue)
1974
+ end
1975
+
1970
1976
  if EMPTY != elm.attributes && EMPTY != elm.attributes.strip then
1971
1977
  elm.attributes = '' << SPACE << elm.attributes.strip
1972
1978
  else
1973
1979
  elm.attributes = ''
1974
1980
  end
1975
1981
 
1976
- elm.attributes << SPACE << attrName << ATTR_EQ << attrValue << DOUBLE_QUATATION
1982
+ elm.attributes << SPACE << attrName << ATTR_EQ << @_attrValue << DOUBLE_QUATATION
1977
1983
  end
1978
1984
 
1979
1985
  end
@@ -2037,9 +2043,8 @@ module Meteor
2037
2043
  elm.arguments.map.each{ |name,attr|
2038
2044
 
2039
2045
  if attr.changed then
2040
- @_attrValue = attr.value
2041
- replace2Regex(@_attrValue)
2042
-
2046
+ @_attrValue = escape(attr.value)
2047
+ #replace2Regex(@_attrValue)
2043
2048
  @pattern_cc = '' << name << SET_ATTR_1
2044
2049
  #@pattern_cc = "#{attrName}=\"[^\"]*\""
2045
2050
  @pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
@@ -3036,9 +3041,9 @@ module Meteor
3036
3041
  #
3037
3042
  def initialize_1(ps)
3038
3043
  @root.document = String.new(ps.document)
3039
- @root.hookDocument = String.new(ps.hookDocument)
3040
- @root.hook = ps.hook
3041
- @root.monoHook = ps.monoHook
3044
+ @root.hookDocument = String.new(ps.rootElement.hookDocument)
3045
+ @root.hook = ps.rootElement.hook
3046
+ @root.monoHook = ps.rootElement.monoHook
3042
3047
  @root.contentType = String.new(ps.contentType);
3043
3048
  end
3044
3049
  private :initialize_1
@@ -3635,26 +3640,26 @@ module Meteor
3635
3640
  #@@pattern_readonly = Regexp.new(READONLY)
3636
3641
  #@@pattern_select = Regexp.new(SELECT)
3637
3642
  #@@pattern_multiple = Regexp.new(MULTIPLE)
3638
-
3639
- SELECTED_M = "\\sselected=\"[^\"]*\"\\s|\\sselected=\"[^\"]*\"$|\\sSELECTED=\"[^\"]*\"\\s|\\sSELECTED=\"[^\"]*\"$"
3640
- SELECTED_M1 = "\\sselected=\"([^\"]*)\"\\s|\\sselected=\"([^\"]*)\"$|\\sSELECTED=\"([^\"]*)\"\\s|\\sSELECTED=\"([^\"]*)\"$"
3641
- SELECTED_R = "selected=\"[^\"]*\"|SELECTED=\"[^\"]*\""
3643
+
3644
+ SELECTED_M = "\\sselected=\"[^\"]*\"\\s|\\sselected=\"[^\"]*\"$"
3645
+ SELECTED_M1 = "\\sselected=\"([^\"]*)\"\\s|\\sselected=\"([^\"]*)\"$"
3646
+ SELECTED_R = "selected=\"[^\"]*\""
3642
3647
  SELECTED_U = "selected=\"selected\""
3643
- CHECKED_M = "\\schecked=\"[^\"]*\"\\s|\\schecked=\"[^\"]*\"$|\\sCHECKED=\"[^\"]*\"\\s|\\sCHECKED=\"[^\"]*\"$"
3644
- CHECKED_M1 = "\\schecked=\"([^\"]*)\"\\s|\\schecked=\"([^\"]*)\"$|\\sCHECKED=\"([^\"]*)\"\\s|\\sCHECKED=\"([^\"]*)\"$"
3645
- CHECKED_R = "checked=\"[^\"]*\"|CHECKED=\"[^\"]*\""
3648
+ CHECKED_M = "\\schecked=\"[^\"]*\"\\s|\\schecked=\"[^\"]*\"$"
3649
+ CHECKED_M1 = "\\schecked=\"([^\"]*)\"\\s|\\schecked=\"([^\"]*)\"$"
3650
+ CHECKED_R = "checked=\"[^\"]*\""
3646
3651
  CHECKED_U = "checked=\"checked\""
3647
- DISABLED_M = "\\sdisabled=\"[^\"]*\"\\s|\\sdisabled=\"[^\"]*\"$|\\sDISABLED=\"[^\"]*\"\\s|\\sDISABLED=\"[^\"]*\"$"
3648
- DISABLED_M1 = "\\sdisabled=\"([^\"]*)\"\\s|\\sdisabled=\"([^\"]*)\"$|\\sDISABLED=\"([^\"]*)\"\\s|\\sDISABLED=\"([^\"]*)\"$"
3649
- DISABLED_R = "disabled=\"[^\"]*\"|DISABLED=\"[^\"]*\""
3652
+ DISABLED_M = "\\sdisabled=\"[^\"]*\"\\s|\\sdisabled=\"[^\"]*\"$"
3653
+ DISABLED_M1 = "\\sdisabled=\"([^\"]*)\"\\s|\\sdisabled=\"([^\"]*)\"$"
3654
+ DISABLED_R = "disabled=\"[^\"]*\""
3650
3655
  DISABLED_U = "disabled=\"disabled\""
3651
- READONLY_M = "\\sreadonly=\"[^\"]*\"\\s|\\sreadonly=\"[^\"]*\"$|\\sREADONLY=\"[^\"]*\"\\s|\\sREADONLY=\"[^\"]*\"$"
3652
- READONLY_M1 = "\\sreadonly=\"([^\"]*)\"\\s|\\sreadonly=\"([^\"]*)\"$|\\sREADONLY=\"([^\"]*)\"\\s|\\sREADONLY=\"([^\"]*)\"$"
3653
- READONLY_R = "readonly=\"[^\"]*\"|READONLY=\"[^\"]*\""
3656
+ READONLY_M = "\\sreadonly=\"[^\"]*\"\\s|\\sreadonly=\"[^\"]*\"$"
3657
+ READONLY_M1 = "\\sreadonly=\"([^\"]*)\"\\s|\\sreadonly=\"([^\"]*)\"$"
3658
+ READONLY_R = "readonly=\"[^\"]*\""
3654
3659
  READONLY_U = "readonly=\"readonly\""
3655
- MULTIPLE_M = "\\smultiple=\"[^\"]*\"\\s|\\smultiple=\"[^\"]*\"$|\\sMULTIPLE=\"[^\"]*\"\\s|\\sMULTIPLE=\"[^\"]*\"$"
3656
- MULTIPLE_M1 = "\\smultiple=\"([^\"]*)\"\\s|\\smultiple=\"([^\"]*)\"$|\\sMULTIPLE=\"([^\"]*)\"\\s|\\sMULTIPLE=\"([^\"]*)\"$"
3657
- MULTIPLE_R = "multiple=\"[^\"]*\"|MULTIPLE=\"[^\"]*\""
3660
+ MULTIPLE_M = "\\smultiple=\"[^\"]*\"\\s|\\smultiple=\"[^\"]*\"$"
3661
+ MULTIPLE_M1 = "\\smultiple=\"([^\"]*)\"\\s|\\smultiple=\"([^\"]*)\"$"
3662
+ MULTIPLE_R = "multiple=\"[^\"]*\""
3658
3663
  MULTIPLE_U = "multiple=\"multiple\""
3659
3664
 
3660
3665
  HTTP_EQUIV = 'http-equiv'
@@ -3730,9 +3735,9 @@ module Meteor
3730
3735
  #
3731
3736
  def initialize_1(ps)
3732
3737
  @root.document = String.new(ps.document)
3733
- @root.hookDocument = String.new(ps.hookDocument)
3734
- @root.hook = ps.hook
3735
- @root.monoHook = ps.monoHook
3738
+ @root.hookDocument = String.new(ps.rootElement.hookDocument)
3739
+ @root.hook = ps.rootElement.hook
3740
+ @root.monoHook = ps.rootElement.monoHook
3736
3741
  @root.contentType = String.new(ps.contentType);
3737
3742
  end
3738
3743
  private :initialize_1
@@ -4098,9 +4103,9 @@ module Meteor
4098
4103
  #
4099
4104
  def initialize_1(ps)
4100
4105
  @root.document = String.new(ps.document)
4101
- @root.hookDocument = String.new(ps.hookDocument)
4102
- @root.hook = ps.hook
4103
- @root.monoHook = ps.monoHook
4106
+ @root.hookDocument = String.new(ps.rootElement.hookDocument)
4107
+ @root.hook = ps.rootElement.hook
4108
+ @root.monoHook = ps.rootElement.monoHook
4104
4109
  @root.contentType = String.new(ps.contentType);
4105
4110
  end
4106
4111
 
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
4
+ version: 0.9.0.1
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: 2008-10-02 00:00:00 -07:00
12
+ date: 2008-10-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15