asip-meteor 0.9.2.3 → 0.9.2.4
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 +54 -45
- metadata +2 -2
data/lib/meteor.rb
CHANGED
@@ -18,12 +18,12 @@
|
|
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.2.
|
21
|
+
# @version 0.9.2.4
|
22
22
|
#
|
23
23
|
|
24
24
|
module Meteor
|
25
25
|
|
26
|
-
VERSION = "0.9.2.
|
26
|
+
VERSION = "0.9.2.4"
|
27
27
|
|
28
28
|
RUBY_VERSION_1_9_0 = '1.9.0'
|
29
29
|
|
@@ -105,6 +105,7 @@ module Meteor
|
|
105
105
|
# @param [Meteor::Element] elm 要素
|
106
106
|
#
|
107
107
|
def initialize_e(elm)
|
108
|
+
#if !elm.origin then
|
108
109
|
@name = elm.name
|
109
110
|
@attributes = String.new(elm.attributes)
|
110
111
|
@pattern = String.new(elm.pattern)
|
@@ -112,27 +113,38 @@ module Meteor
|
|
112
113
|
@empty = elm.empty
|
113
114
|
@cx = elm.cx
|
114
115
|
@mono = elm.mono
|
115
|
-
@parser = elm.parser
|
116
116
|
@arguments = AttributeMap.new(elm.arguments)
|
117
117
|
@origin = elm
|
118
|
-
|
118
|
+
#else
|
119
|
+
# @name = elm.origin.name
|
120
|
+
# @attributes = String.new(elm.origin.attributes)
|
121
|
+
# @pattern = String.new(elm.origin.pattern)
|
122
|
+
# @document = String.new(elm.origin.document)
|
123
|
+
# @empty = elm.origin.empty
|
124
|
+
# @cx = elm.origin.cx
|
125
|
+
# @mono = elm.origin.mono
|
126
|
+
# @arguments = AttributeMap.new(elm.origin.arguments)
|
127
|
+
# @origin = elm
|
128
|
+
#end
|
129
|
+
@parser = elm.parser
|
130
|
+
@usable = true
|
119
131
|
end
|
120
132
|
private :initialize_e
|
121
133
|
|
122
|
-
attr_accessor :name
|
123
|
-
attr_accessor :attributes
|
124
|
-
attr_accessor :mixed_content
|
125
|
-
attr_accessor :pattern
|
126
|
-
attr_accessor :document
|
127
|
-
attr_accessor :empty
|
128
|
-
attr_accessor :cx
|
129
|
-
attr_accessor :mono
|
130
|
-
attr_accessor :parser
|
131
|
-
attr_accessor :type_value
|
132
|
-
attr_accessor :arguments
|
133
|
-
attr_accessor :usable
|
134
|
-
attr_accessor :origin
|
135
|
-
attr_accessor :copy
|
134
|
+
attr_accessor :name #要素名
|
135
|
+
attr_accessor :attributes #属性群
|
136
|
+
attr_accessor :mixed_content #内容
|
137
|
+
attr_accessor :pattern #パターン
|
138
|
+
attr_accessor :document #ドキュメント
|
139
|
+
attr_accessor :empty #内容存在フラグ
|
140
|
+
attr_accessor :cx #コメント拡張タグフラグ
|
141
|
+
attr_accessor :mono #子要素存在フラグ
|
142
|
+
attr_accessor :parser #パーサ
|
143
|
+
attr_accessor :type_value #タイプ属性
|
144
|
+
attr_accessor :arguments #パターン変更用属性マップ
|
145
|
+
attr_accessor :usable #有効・無効フラグ
|
146
|
+
attr_accessor :origin #原本ポインタ
|
147
|
+
attr_accessor :copy #複製ポインタ
|
136
148
|
|
137
149
|
#
|
138
150
|
# コピーを作成する
|
@@ -141,7 +153,8 @@ module Meteor
|
|
141
153
|
def self.new!(*args)
|
142
154
|
case args.length
|
143
155
|
when ONE
|
144
|
-
self.new_1!(args[0])
|
156
|
+
#self.new_1!(args[0])
|
157
|
+
args[0].clone
|
145
158
|
when TWO
|
146
159
|
@obj = args[1].root_element.element
|
147
160
|
if @obj then
|
@@ -157,26 +170,25 @@ module Meteor
|
|
157
170
|
@obj
|
158
171
|
end
|
159
172
|
end
|
160
|
-
end
|
173
|
+
end
|
161
174
|
|
162
175
|
#
|
163
|
-
#
|
164
|
-
# @param [Element] elm 要素
|
176
|
+
# 複製する
|
165
177
|
#
|
166
|
-
def
|
167
|
-
|
168
|
-
if
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
178
|
+
def clone
|
179
|
+
obj = self.parser.e_cache[self.object_id]
|
180
|
+
if obj then
|
181
|
+
obj.attributes = String.new(self.attributes)
|
182
|
+
obj.mixed_content = String.new(self.mixed_content)
|
183
|
+
obj.pattern = String.new(self.pattern)
|
184
|
+
obj.document = String.new(self.document)
|
185
|
+
obj.arguments = AttributeMap.new(self.arguments)
|
186
|
+
obj.usable = true
|
187
|
+
obj
|
176
188
|
else
|
177
|
-
|
178
|
-
|
179
|
-
|
189
|
+
obj = self.new(self)
|
190
|
+
self.parser.e_cache[self.object_id] = obj
|
191
|
+
obj
|
180
192
|
end
|
181
193
|
end
|
182
194
|
|
@@ -283,8 +295,8 @@ module Meteor
|
|
283
295
|
@parser.remove_element(self)
|
284
296
|
end
|
285
297
|
|
286
|
-
def
|
287
|
-
@parser.
|
298
|
+
def flush
|
299
|
+
@parser.flush
|
288
300
|
end
|
289
301
|
|
290
302
|
#
|
@@ -639,8 +651,7 @@ module Meteor
|
|
639
651
|
#内容あり要素の場合
|
640
652
|
if elm.empty then
|
641
653
|
elm2 = elm.child(elm)
|
642
|
-
execute(elm2)
|
643
|
-
#elm2.flush
|
654
|
+
execute(elm2)
|
644
655
|
end
|
645
656
|
end
|
646
657
|
|
@@ -669,9 +680,8 @@ module Meteor
|
|
669
680
|
elm2.parser.root_element.document = elm.mixed_content
|
670
681
|
end
|
671
682
|
execute(elm2, item)
|
672
|
-
elm2.
|
673
|
-
end
|
674
|
-
#elm2.flush
|
683
|
+
elm2.flush
|
684
|
+
end
|
675
685
|
end
|
676
686
|
end
|
677
687
|
|
@@ -797,7 +807,6 @@ module Meteor
|
|
797
807
|
#getAttributeValue
|
798
808
|
GET_ATTR_1 = '="([^"]*)"'
|
799
809
|
#attributeMap
|
800
|
-
#todo
|
801
810
|
GET_ATTRS_MAP = '([^\\s]*)="([^\"]*)"'
|
802
811
|
#removeAttribute
|
803
812
|
ERASE_ATTR_1 = '="[^\"]*"\\s'
|
@@ -2414,7 +2423,7 @@ module Meteor
|
|
2414
2423
|
#
|
2415
2424
|
# 出力する
|
2416
2425
|
#
|
2417
|
-
def
|
2426
|
+
def flush
|
2418
2427
|
reflect
|
2419
2428
|
|
2420
2429
|
#puts @root.document
|
@@ -3385,7 +3394,7 @@ module Meteor
|
|
3385
3394
|
elsif is_match(DISABLED, attr_name) && is_match(DISABLE_ELEMENT, elm.name) then
|
3386
3395
|
get_attribute_value_2_r(elm,@@pattern_disabled_m)
|
3387
3396
|
#get_attribute_value_2_r(elm,DISABLED_M)
|
3388
|
-
elsif is_match(CHECKED, attr_name) &&
|
3397
|
+
elsif is_match(CHECKED, attr_name) && is_match(INPUT,elm.name) && is_match(RADIO, get_type(elm)) then
|
3389
3398
|
get_attribute_value_2_r(elm,@@pattern_checked_m)
|
3390
3399
|
#get_attribute_value_2_r(elm,CHECKED_M)
|
3391
3400
|
elsif is_match(READONLY, attr_name) && (is_match(TEXTAREA,elm.name) || (is_match(INPUT,elm.name) && is_match(READONLY_TYPE, get_type(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.2.
|
4
|
+
version: 0.9.2.4
|
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-06-
|
12
|
+
date: 2009-06-20 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|