asip-meteor 0.9.0.1 → 0.9.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/meteor.rb +22 -5
  2. 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.0
21
+ # @version 0.9.0.2
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"
30
+ VERSION = "0.9.0.2"
31
31
 
32
32
  #
33
33
  # 要素クラス
@@ -153,7 +153,7 @@ module Meteor
153
153
  #
154
154
  def [](name)
155
155
  if !name.kind_of?(String) || name != ':content' then
156
- getAttributeValue(name)
156
+ attribute(name)
157
157
  else
158
158
  content()
159
159
  end
@@ -2961,14 +2961,19 @@ module Meteor
2961
2961
  #@@pattern_multiple = Regexp.new(MULTIPLE)
2962
2962
 
2963
2963
  SELECTED_M = "\\sselected\\s|\\sselected$|\\sSELECTED\\s|\\sSELECTED$"
2964
+ #SELECTED_M = [' selected ',' selected',' SELECTED ',' SELECTED']
2964
2965
  SELECTED_R = "selected\\s|selected$|SELECTED\\s|SELECTED$"
2965
2966
  CHECKED_M = "\\schecked\\s|\\schecked$|\\sCHECKED\\s|\\sCHECKED$"
2967
+ #CHECKED_M = [' checked ',' checked',' CHECKED ',' CHECKED']
2966
2968
  CHECKED_R = "checked\\s|checked$|CHECKED\\s|CHECKED$"
2967
2969
  DISABLED_M = "\\sdisabled\\s|\\sdisabled$|\\sDISABLED\\s|\\sDISABLED$"
2970
+ #DISABLED_M = [' disabled ',' disiabled',' DISABLED ',' DISABLED']
2968
2971
  DISABLED_R = "disabled\\s|disabled$|DISABLED\\s|DISABLED$"
2969
2972
  READONLY_M = "\\sreadonly\\s|\\sreadonly$|\\sREADONLY\\s|\\sREADONLY$"
2973
+ #READONLY_M = [' readonly ',' readonly',' READONLY ',' READONLY']
2970
2974
  READONLY_R = "readonly\\s|readonly$|READONLY\\s|READONLY$"
2971
2975
  MULTIPLE_M = "\\smultiple\\s|\\smultiple$|\\sMULTIPLE\\s|\\sMULTIPLE$"
2976
+ #MULTIPLE_M = [' multiple ',' multiple',' MULTIPLE ',' MULTIPLE']
2972
2977
  MULTIPLE_R = "multiple\\s|multiple$|MULTIPLE\\s|MULTIPLE$"
2973
2978
 
2974
2979
  @@pattern_selected_m = Regexp.new(SELECTED_M)
@@ -3372,14 +3377,19 @@ module Meteor
3372
3377
  def editAttributes_(elm,attrName,attrValue)
3373
3378
  if isMatch(SELECTED, attrName) && isMatch(OPTION,elm.name) then
3374
3379
  editAttributes_5(elm,attrName,attrValue,@@pattern_selected_m,@@pattern_selected_r)
3380
+ #editAttributes_5(elm,attrName,attrValue,SELECTED_M,@@pattern_selected_r)
3375
3381
  elsif isMatch(MULTIPLE, attrName) && isMatch(SELECT,elm.name)
3376
3382
  editAttributes_5(elm,attrName,attrValue,@@pattern_multiple_m,@@pattern_multiple_r)
3383
+ #editAttributes_5(elm,attrName,attrValue,MULTIPLE_M,@@pattern_multiple_r)
3377
3384
  elsif isMatch(DISABLED, attrName) && isMatch(DISABLE_ELEMENT, elm.name) then
3378
3385
  editAttributes_5(elm,attrName,attrValue,@@pattern_disabled_m,@@pattern_disabled_r)
3386
+ #editAttributes_5(elm,attrName,attrValue,DISABLED_M,@@pattern_disabled_r)
3379
3387
  elsif isMatch(CHECKED, attrName) && isMatch(INPUT,elm.name) && isMatch(RADIO, getType(elm)) then
3380
3388
  editAttributes_5(elm,attrName,attrValue,@@pattern_checked_m,@@pattern_checked_r)
3389
+ #editAttributes_5(elm,attrName,attrValue,CHECKED_M,@@pattern_checked_r)
3381
3390
  elsif isMatch(READONLY, attrName) && (isMatch(TEXTAREA,elm.name) || (isMatch(INPUT,elm.name) && isMatch(READONLY_TYPE, getType(elm)))) then
3382
3391
  editAttributes_5(elm,attrName,attrValue,@@pattern_readonly_m,@@pattern_readonly_r)
3392
+ #editAttributes_5(elm,attrName,attrValue,READONLY_M,@@pattern_readonly_r)
3383
3393
  else
3384
3394
  super(elm,attrName,attrValue)
3385
3395
  end
@@ -3393,6 +3403,7 @@ module Meteor
3393
3403
  @res = match_p.match(elm.attributes)
3394
3404
 
3395
3405
  if !@res then
3406
+ #if elm.attributes.include?(match_p[0]) || elm.attributes.rindex(match_p[1],elm.attributes.length - 1) == 0 || elm.attributes.include?(match_p[2]) || elm.attributes.rindex(match_p[3],elm.attributes.length - 1) == 0
3396
3407
  if !EMPTY.eql?(elm.attributes) && !EMPTY.eql?(elm.attributes.strip) then
3397
3408
  elm.attributes = '' << SPACE << elm.attributes.strip
3398
3409
  else
@@ -3416,14 +3427,19 @@ module Meteor
3416
3427
  def getAttributeValue_(elm,attrName)
3417
3428
  if isMatch(SELECTED, attrName) && isMatch(OPTION,elm.name) then
3418
3429
  getAttributeValue_2_r(elm,@@pattern_selected_m)
3430
+ #getAttributeValue_2_r(elm,SELECTED_M)
3419
3431
  elsif isMatch(MULTIPLE, attrName) && isMatch(SELECT,elm.name)
3420
3432
  getAttributeValue_2_r(elm,@@pattern_multiple_m)
3433
+ #getAttributeValue_2_r(elm,MULTIPLE_M)
3421
3434
  elsif isMatch(DISABLED, attrName) && isMatch(DISABLE_ELEMENT, elm.name) then
3422
3435
  getAttributeValue_2_r(elm,@@pattern_disabled_m)
3436
+ #getAttributeValue_2_r(elm,DISABLED_M)
3423
3437
  elsif isMatch(CHECKED, attrName) && isMatch(INPUT,elm.name) && isMatch(RADIO, getType(elm)) then
3424
3438
  getAttributeValue_2_r(elm,@@pattern_checked_m)
3439
+ #getAttributeValue_2_r(elm,CHECKED_M)
3425
3440
  elsif isMatch(READONLY, attrName) && (isMatch(TEXTAREA,elm.name) || (isMatch(INPUT,elm.name) && isMatch(READONLY_TYPE, getType(elm)))) then
3426
3441
  getAttributeValue_2_r(elm,@@pattern_readonly_m)
3442
+ #getAttributeValue_2_r(elm,READONLY_M)
3427
3443
  else
3428
3444
  super(elm,attrName)
3429
3445
  end
@@ -3432,9 +3448,9 @@ module Meteor
3432
3448
 
3433
3449
  def getType(elm)
3434
3450
  if !elm.type_value
3435
- elm.type_value = getAttributeValue_2(elm, TYPE_L)
3451
+ elm.type_value = getAttributeValue_(elm, TYPE_L)
3436
3452
  if !elm.type_value then
3437
- elm.type_value = getAttributeValue_2(elm, TYPE_U)
3453
+ elm.type_value = getAttributeValue_(elm, TYPE_U)
3438
3454
  end
3439
3455
  end
3440
3456
  elm.type_value
@@ -3446,6 +3462,7 @@ module Meteor
3446
3462
  @res = match_p.match(elm.attributes)
3447
3463
 
3448
3464
  if @res then
3465
+ #if elm.attributes.include?(match_p[0]) || elm.attributes.rindex(match_p[1],elm.attributes.length - 1) == 0 || elm.attributes.include?(match_p[2]) || elm.attributes.rindex(match_p[3],elm.attributes.length - 1) == 0 then
3449
3466
  TRUE
3450
3467
  else
3451
3468
  FALSE
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.1
4
+ version: 0.9.0.2
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-03 00:00:00 -07:00
12
+ date: 2008-10-05 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15