asip-meteor 0.9.0.8 → 0.9.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/meteor.rb +28 -12
- 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.9
|
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.9"
|
31
31
|
|
32
32
|
#
|
33
33
|
# 要素クラス
|
@@ -90,7 +90,22 @@ module Meteor
|
|
90
90
|
@arguments = AttributeMap.new(elm.arguments)
|
91
91
|
@origin = elm.object_id
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
|
+
def self.copy(elm)
|
95
|
+
@obj = elm.parser.e_cache[elm.origin]
|
96
|
+
if @obj then
|
97
|
+
@obj.attributes = String.new(elm.attributes)
|
98
|
+
@obj.pattern = String.new(elm.pattern)
|
99
|
+
@obj.document = String.new(elm.document)
|
100
|
+
@obj.arguments = AttributeMap.new(elm.arguments)
|
101
|
+
@obj.usable = 0
|
102
|
+
@obj
|
103
|
+
else
|
104
|
+
self.new(elm)
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
108
|
+
|
94
109
|
attr_accessor :name
|
95
110
|
attr_accessor :attributes
|
96
111
|
attr_accessor :mixed_content
|
@@ -839,6 +854,7 @@ module Meteor
|
|
839
854
|
end
|
840
855
|
|
841
856
|
attr_accessor :parent
|
857
|
+
attr_accessor :e_cache
|
842
858
|
|
843
859
|
#
|
844
860
|
# フックフラグをセットする
|
@@ -962,15 +978,15 @@ module Meteor
|
|
962
978
|
|
963
979
|
def get_encoding()
|
964
980
|
case @characterEncoding
|
965
|
-
when
|
981
|
+
when 'UTF-8'
|
966
982
|
Kconv::UTF8
|
967
|
-
when
|
983
|
+
when 'ISO-2022-JP'
|
968
984
|
Kconv::JIS
|
969
|
-
when
|
985
|
+
when 'Shift_JIS'
|
970
986
|
Kconv::SJIS
|
971
|
-
when
|
987
|
+
when 'EUC-JP'
|
972
988
|
Kconv::EUC
|
973
|
-
when
|
989
|
+
when 'ASCII'
|
974
990
|
Kconv::ASCII
|
975
991
|
#when "UTF-16"
|
976
992
|
# return KConv::UTF16
|
@@ -2292,11 +2308,11 @@ module Meteor
|
|
2292
2308
|
def reflect()
|
2293
2309
|
|
2294
2310
|
@e_cache.values.each { |item|
|
2295
|
-
if item.usable
|
2311
|
+
if item.usable == 0 then
|
2296
2312
|
editDocument_1(item)
|
2297
2313
|
editPattern_(item)
|
2314
|
+
item.usable = 1
|
2298
2315
|
end
|
2299
|
-
item.usable = 1
|
2300
2316
|
}
|
2301
2317
|
#@e_cache.clear
|
2302
2318
|
end
|
@@ -2323,7 +2339,7 @@ module Meteor
|
|
2323
2339
|
#@root.hookDocument << TAG_OPEN3 << @root.mutableElement.name << TAG_CLOSE
|
2324
2340
|
@root.hookDocument << "<#{@root.mutableElement.name}#{@_attributes}>#{@root.document}</#{@root.mutableElement.name}>"
|
2325
2341
|
end
|
2326
|
-
@root.mutableElement = Element.
|
2342
|
+
@root.mutableElement = Element.copy(@root.element)
|
2327
2343
|
@root.document = String.new(@root.element.mixed_content)
|
2328
2344
|
else
|
2329
2345
|
if @root.monoHook then
|
@@ -2339,7 +2355,7 @@ module Meteor
|
|
2339
2355
|
#@root.hookDocument << TAG_OPEN3 << @root.mutableElement.name << TAG_CLOSE
|
2340
2356
|
@root.hookDocument << "<#{@root.mutableElement.name}#{@root.mutableElement.attributes}>#{@root.mutableElement.mixed_content}</#{@root.mutableElement.name}>"
|
2341
2357
|
end
|
2342
|
-
@root.mutableElement = Element.
|
2358
|
+
@root.mutableElement = Element.copy(@root.element)
|
2343
2359
|
else
|
2344
2360
|
#フック判定がFALSEの場合
|
2345
2361
|
clean
|
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.9
|
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-03-
|
12
|
+
date: 2009-03-22 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|