meteor 0.9.21 → 0.9.23
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.
- checksums.yaml +4 -4
- data/ChangeLog +8 -0
- data/Gemfile.lock +1 -1
- data/lib/meteor/core/kernel.rb +98 -0
- data/lib/meteor/elements.rb +4 -4
- data/lib/meteor/ml/html4/parser_impl.rb +4 -98
- data/lib/meteor/ml/xhtml4/parser_impl.rb +7 -99
- data/lib/meteor/ml/xml/parser_impl.rb +3 -3
- data/lib/meteor/parsers.rb +14 -14
- data/lib/meteor.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 280d6970523834a12f7c71dc862add46a45f23ba59f2d7339ee23633323edfa3
|
|
4
|
+
data.tar.gz: 86badb6f85c41fb0c664b8d154c46865e95999634106cac57d01c6db364b9ae9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e72c280022b57f63af5b25dd2c98c9ce9a9ed88259112ce4a177112af8ebe2edfb23acbb78dac4831e1284f92146c81015d99e46ec975439d1fbc2c4a46b5c30
|
|
7
|
+
data.tar.gz: 042247ef84e70b88e82025308f15fae566f2f2175a14bf5cc490565fb70f45456b06a6fcee41f73ed483a935b6d2a3f711d90a27f05fb63c18e92ab6ecf95051
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/lib/meteor/core/kernel.rb
CHANGED
|
@@ -52,6 +52,39 @@ module Meteor
|
|
|
52
52
|
@@pattern_clean1 = Regexp.new("<!--\\s@[^<>]*\\s[^<>]*(\\s)*-->")
|
|
53
53
|
@@pattern_clean2 = Regexp.new("<!--\\s\\/@[^<>]*(\\s)*-->")
|
|
54
54
|
|
|
55
|
+
BR = "<br>"
|
|
56
|
+
BR_RE = BR
|
|
57
|
+
|
|
58
|
+
TABLE_FOR_ESCAPE_ = {
|
|
59
|
+
"&" => "&",
|
|
60
|
+
"\"" => """,
|
|
61
|
+
"'" => "'",
|
|
62
|
+
"<" => "<",
|
|
63
|
+
">" => ">",
|
|
64
|
+
" " => " "
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
TABLE_FOR_ESCAPE_CONTENT_ = {
|
|
68
|
+
"&" => "&",
|
|
69
|
+
"\"" => """,
|
|
70
|
+
"'" => "'",
|
|
71
|
+
"<" => "<",
|
|
72
|
+
">" => ">",
|
|
73
|
+
" " => " ",
|
|
74
|
+
"\r\n" => BR,
|
|
75
|
+
"\r" => BR,
|
|
76
|
+
"\n" => BR
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
PATTERN_ESCAPE = "[&\"'<> ]"
|
|
80
|
+
PATTERN_ESCAPE_CONTENT = "[&\"'<> \\n]"
|
|
81
|
+
@@pattern_escape = Regexp.new(PATTERN_ESCAPE)
|
|
82
|
+
@@pattern_escape_content = Regexp.new(PATTERN_ESCAPE_CONTENT)
|
|
83
|
+
|
|
84
|
+
PATTERN_UNESCAPE = "&(amp|quot|apos|gt|lt|nbsp);"
|
|
85
|
+
@@pattern_unescape = Regexp.new(PATTERN_UNESCAPE)
|
|
86
|
+
@@pattern_br_2 = Regexp.new(BR_RE)
|
|
87
|
+
|
|
55
88
|
attr_accessor :element_cache
|
|
56
89
|
attr_accessor :doc_type
|
|
57
90
|
attr_accessor :document_hook
|
|
@@ -2194,6 +2227,71 @@ module Meteor
|
|
|
2194
2227
|
end
|
|
2195
2228
|
|
|
2196
2229
|
private :create
|
|
2230
|
+
|
|
2231
|
+
def escape(content)
|
|
2232
|
+
# replace special character (特殊文字の置換)
|
|
2233
|
+
content = content.gsub(@@pattern_escape, TABLE_FOR_ESCAPE_)
|
|
2234
|
+
|
|
2235
|
+
content
|
|
2236
|
+
end
|
|
2237
|
+
|
|
2238
|
+
def escape_content(content, elm)
|
|
2239
|
+
# replace special character (特殊文字の置換)
|
|
2240
|
+
content = content.gsub(@@pattern_escape_content, TABLE_FOR_ESCAPE_CONTENT_)
|
|
2241
|
+
|
|
2242
|
+
content
|
|
2243
|
+
end
|
|
2244
|
+
|
|
2245
|
+
private :escape
|
|
2246
|
+
private :escape_content
|
|
2247
|
+
|
|
2248
|
+
def unescape(content)
|
|
2249
|
+
# replace special character (特殊文字の置換)
|
|
2250
|
+
# 「<」<-「<」
|
|
2251
|
+
# 「>」<-「>」
|
|
2252
|
+
# 「"」<-「"l」
|
|
2253
|
+
# 「 」<-「 」
|
|
2254
|
+
# 「&」<-「&」
|
|
2255
|
+
content.gsub(@@pattern_unescape) do
|
|
2256
|
+
case $1
|
|
2257
|
+
when "amp"
|
|
2258
|
+
"&"
|
|
2259
|
+
when "quot"
|
|
2260
|
+
"\""
|
|
2261
|
+
when "apos"
|
|
2262
|
+
"'"
|
|
2263
|
+
when "gt"
|
|
2264
|
+
">"
|
|
2265
|
+
when "lt"
|
|
2266
|
+
"<"
|
|
2267
|
+
when "nbsp"
|
|
2268
|
+
" "
|
|
2269
|
+
end
|
|
2270
|
+
end
|
|
2271
|
+
|
|
2272
|
+
content
|
|
2273
|
+
end
|
|
2274
|
+
|
|
2275
|
+
private :unescape
|
|
2276
|
+
|
|
2277
|
+
def br_to_newline(content)
|
|
2278
|
+
if (elm.cx || !is_match(@@match_tag_2, elm.name)) && content.include?(BR)
|
|
2279
|
+
# 「<br>」->「¥r?¥n」
|
|
2280
|
+
content.gsub!(@@pattern_br_2, @root.kaigyo_code)
|
|
2281
|
+
end
|
|
2282
|
+
end
|
|
2283
|
+
|
|
2284
|
+
private :br_to_newline
|
|
2285
|
+
|
|
2286
|
+
def unescape_content(content, elm)
|
|
2287
|
+
content_ = unescape(content)
|
|
2288
|
+
|
|
2289
|
+
br_to_newline(content_)
|
|
2290
|
+
|
|
2291
|
+
content_
|
|
2292
|
+
end
|
|
2293
|
+
|
|
2294
|
+
private :unescape_content
|
|
2197
2295
|
end
|
|
2198
2296
|
end
|
|
2199
2297
|
end
|
data/lib/meteor/elements.rb
CHANGED
|
@@ -24,13 +24,13 @@ module Meteor
|
|
|
24
24
|
|
|
25
25
|
#
|
|
26
26
|
#@overload add(type,relative_path,enc)
|
|
27
|
-
#
|
|
27
|
+
# add parser (パーサを追加する)
|
|
28
28
|
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
29
29
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
30
30
|
# @param [String] enc character encoding (エンコーディング)
|
|
31
31
|
# @return [Meteor::Parser] parser (パーサ)
|
|
32
32
|
#@overload add(type,relative_path)
|
|
33
|
-
#
|
|
33
|
+
# add parser (パーサを追加する)
|
|
34
34
|
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
35
35
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
36
36
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -41,13 +41,13 @@ module Meteor
|
|
|
41
41
|
|
|
42
42
|
#
|
|
43
43
|
# @overload add_str(type, relative_url, doc)
|
|
44
|
-
#
|
|
44
|
+
# add parser (パーサを追加する)
|
|
45
45
|
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
46
46
|
# @param [String] relative_url relative URL (相対URL)
|
|
47
47
|
# @param [String] doc document (ドキュメント)
|
|
48
48
|
# @return [Meteor::Parser] parser (パーサ)
|
|
49
49
|
# @overload add_str(relative_url, doc)
|
|
50
|
-
#
|
|
50
|
+
# add parser (パーサを追加する)
|
|
51
51
|
# @param [String] relative_url relative URL (相対URL)
|
|
52
52
|
# @param [String] doc document (ドキュメント)
|
|
53
53
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -12,6 +12,7 @@ module Meteor
|
|
|
12
12
|
# KAIGYO_CODE = "\r\n|\n|\r"
|
|
13
13
|
KAIGYO_CODE = ["\r\n", "\n", "\r"]
|
|
14
14
|
BR = "<br>"
|
|
15
|
+
BR_RE = BR
|
|
15
16
|
|
|
16
17
|
# @@match_tag = "br|hr|img|input|meta|base"
|
|
17
18
|
#[Array] void elemets (空要素)
|
|
@@ -70,36 +71,6 @@ module Meteor
|
|
|
70
71
|
# @@pattern_match_tag = Regexp.new(@@match_tag)
|
|
71
72
|
# @@pattern_match_tag2 = Regexp.new(@@match_tag_2)
|
|
72
73
|
|
|
73
|
-
TABLE_FOR_ESCAPE_ = {
|
|
74
|
-
"&" => "&",
|
|
75
|
-
"\"" => """,
|
|
76
|
-
"'" => "'",
|
|
77
|
-
"<" => "<",
|
|
78
|
-
">" => ">",
|
|
79
|
-
" " => " "
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
TABLE_FOR_ESCAPE_CONTENT_ = {
|
|
83
|
-
"&" => "&",
|
|
84
|
-
"\"" => """,
|
|
85
|
-
"'" => "'",
|
|
86
|
-
"<" => "<",
|
|
87
|
-
">" => ">",
|
|
88
|
-
" " => " ",
|
|
89
|
-
"\r\n" => "<br>",
|
|
90
|
-
"\r" => "<br>",
|
|
91
|
-
"\n" => "<br>"
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
PATTERN_ESCAPE = "[&\"'<> ]"
|
|
95
|
-
PATTERN_ESCAPE_CONTENT = "[&\"'<> \\n]"
|
|
96
|
-
@@pattern_escape = Regexp.new(PATTERN_ESCAPE)
|
|
97
|
-
@@pattern_escape_content = Regexp.new(PATTERN_ESCAPE_CONTENT)
|
|
98
|
-
|
|
99
|
-
PATTERN_UNESCAPE = "&(amp|quot|apos|gt|lt|nbsp);"
|
|
100
|
-
@@pattern_unescape = Regexp.new(PATTERN_UNESCAPE)
|
|
101
|
-
@@pattern_br_2 = Regexp.new(BR)
|
|
102
|
-
|
|
103
74
|
#
|
|
104
75
|
# initializer (イニシャライザ)
|
|
105
76
|
# @overload initialize
|
|
@@ -153,7 +124,7 @@ module Meteor
|
|
|
153
124
|
#
|
|
154
125
|
def analyze_ml
|
|
155
126
|
analyze_content_type
|
|
156
|
-
|
|
127
|
+
analyze_newline
|
|
157
128
|
|
|
158
129
|
@res = nil
|
|
159
130
|
end
|
|
@@ -197,7 +168,7 @@ module Meteor
|
|
|
197
168
|
#
|
|
198
169
|
# analuze document , set newline (ドキュメントをパースし、改行コードをセットする)
|
|
199
170
|
#
|
|
200
|
-
def
|
|
171
|
+
def analyze_newline
|
|
201
172
|
for a in KAIGYO_CODE
|
|
202
173
|
if @root.document.include?(a)
|
|
203
174
|
@root.kaigyo_code = a
|
|
@@ -206,7 +177,7 @@ module Meteor
|
|
|
206
177
|
end
|
|
207
178
|
end
|
|
208
179
|
|
|
209
|
-
protected :
|
|
180
|
+
protected :analyze_newline
|
|
210
181
|
|
|
211
182
|
#
|
|
212
183
|
# get element using tag name (要素のタグ名で検索し、要素を取得する)
|
|
@@ -645,71 +616,6 @@ module Meteor
|
|
|
645
616
|
end
|
|
646
617
|
|
|
647
618
|
private :remove_attrs_
|
|
648
|
-
|
|
649
|
-
def escape(content)
|
|
650
|
-
# replace special character (特殊文字の置換)
|
|
651
|
-
content = content.gsub(@@pattern_escape, TABLE_FOR_ESCAPE_)
|
|
652
|
-
|
|
653
|
-
content
|
|
654
|
-
end
|
|
655
|
-
|
|
656
|
-
def escape_content(content, elm)
|
|
657
|
-
# replace special character (特殊文字の置換)
|
|
658
|
-
content = content.gsub(@@pattern_escape_content, TABLE_FOR_ESCAPE_CONTENT_)
|
|
659
|
-
|
|
660
|
-
content
|
|
661
|
-
end
|
|
662
|
-
|
|
663
|
-
private :escape
|
|
664
|
-
private :escape_content
|
|
665
|
-
|
|
666
|
-
def unescape(content)
|
|
667
|
-
# replace special character (特殊文字の置換)
|
|
668
|
-
# 「<」<-「<」
|
|
669
|
-
# 「>」<-「>」
|
|
670
|
-
# 「"」<-「"l」
|
|
671
|
-
# 「 」<-「 」
|
|
672
|
-
# 「&」<-「&」
|
|
673
|
-
content.gsub(@@pattern_unescape) do
|
|
674
|
-
case $1
|
|
675
|
-
when "amp"
|
|
676
|
-
"&"
|
|
677
|
-
when "quot"
|
|
678
|
-
"\""
|
|
679
|
-
when "apos"
|
|
680
|
-
"'"
|
|
681
|
-
when "gt"
|
|
682
|
-
">"
|
|
683
|
-
when "lt"
|
|
684
|
-
"<"
|
|
685
|
-
when "nbsp"
|
|
686
|
-
" "
|
|
687
|
-
end
|
|
688
|
-
end
|
|
689
|
-
|
|
690
|
-
content
|
|
691
|
-
end
|
|
692
|
-
|
|
693
|
-
private :unescape
|
|
694
|
-
|
|
695
|
-
def br_to_newline(content)
|
|
696
|
-
if (elm.cx || !is_match(@@match_tag_2, elm.name)) && content.include?(BR)
|
|
697
|
-
# 「<br>」->「¥r?¥n」
|
|
698
|
-
content.gsub!(@@pattern_br_2, @root.kaigyo_code)
|
|
699
|
-
end
|
|
700
|
-
end
|
|
701
|
-
|
|
702
|
-
private :br_to_newline
|
|
703
|
-
|
|
704
|
-
def unescape_content(content, elm)
|
|
705
|
-
content_ = unescape(content)
|
|
706
|
-
|
|
707
|
-
br_to_newline(content_)
|
|
708
|
-
|
|
709
|
-
content_
|
|
710
|
-
end
|
|
711
|
-
|
|
712
|
-
private :unescape_content
|
|
713
619
|
end
|
|
714
620
|
end
|
|
715
621
|
end
|
|
@@ -11,6 +11,7 @@ module Meteor
|
|
|
11
11
|
# KAIGYO_CODE = "\r?\n|\r"
|
|
12
12
|
KAIGYO_CODE = ["\r\n", "\n", "\r"]
|
|
13
13
|
BR = "<br/>"
|
|
14
|
+
BR_RE = "<br\\/>"
|
|
14
15
|
|
|
15
16
|
# @@match_tag_2 = "textarea|option|pre"
|
|
16
17
|
#[Array] elements where line breaks do not need to be converted to <br> (改行を<br/>に変換する必要のない要素)
|
|
@@ -66,36 +67,6 @@ module Meteor
|
|
|
66
67
|
# @@pattern_match_tag = Regexp.new(@@match_tag)
|
|
67
68
|
# @@pattern_match_tag2 = Regexp.new(@@match_tag_2)
|
|
68
69
|
|
|
69
|
-
TABLE_FOR_ESCAPE_ = {
|
|
70
|
-
"&" => "&",
|
|
71
|
-
"\"" => """,
|
|
72
|
-
"'" => "'",
|
|
73
|
-
"<" => "<",
|
|
74
|
-
">" => ">",
|
|
75
|
-
" " => " "
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
TABLE_FOR_ESCAPE_CONTENT_ = {
|
|
79
|
-
"&" => "&",
|
|
80
|
-
"\"" => """,
|
|
81
|
-
"'" => "'",
|
|
82
|
-
"<" => "<",
|
|
83
|
-
">" => ">",
|
|
84
|
-
" " => " ",
|
|
85
|
-
"\r\n" => "<br/>",
|
|
86
|
-
"\r" => "<br/>",
|
|
87
|
-
"\n" => "<br/>"
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
PATTERN_ESCAPE = "[&\"'<> ]"
|
|
91
|
-
PATTERN_ESCAPE_CONTENT = "[&\"'<> \\n]"
|
|
92
|
-
@@pattern_escape = Regexp.new(PATTERN_ESCAPE)
|
|
93
|
-
@@pattern_escape_content = Regexp.new(PATTERN_ESCAPE_CONTENT)
|
|
94
|
-
|
|
95
|
-
PATTERN_UNESCAPE = "&(amp|quot|apos|gt|lt|nbsp);"
|
|
96
|
-
@@pattern_unescape = Regexp.new(PATTERN_UNESCAPE)
|
|
97
|
-
@@pattern_br_2 = Regexp.new("<br\\/>")
|
|
98
|
-
|
|
99
70
|
#
|
|
100
71
|
# initializer (イニシャライザ)
|
|
101
72
|
# @overload initialize
|
|
@@ -149,7 +120,7 @@ module Meteor
|
|
|
149
120
|
#
|
|
150
121
|
def analyze_ml
|
|
151
122
|
analyze_content_type
|
|
152
|
-
|
|
123
|
+
analyze_newline
|
|
153
124
|
@res = nil
|
|
154
125
|
end
|
|
155
126
|
|
|
@@ -192,7 +163,7 @@ module Meteor
|
|
|
192
163
|
#
|
|
193
164
|
# analyze document , set newline (ドキュメントをパースし、改行コードをセットする)
|
|
194
165
|
#
|
|
195
|
-
def
|
|
166
|
+
def analyze_newline
|
|
196
167
|
for a in KAIGYO_CODE
|
|
197
168
|
if @root.document.include?(a)
|
|
198
169
|
@root.kaigyo_code = a
|
|
@@ -200,7 +171,7 @@ module Meteor
|
|
|
200
171
|
end
|
|
201
172
|
end
|
|
202
173
|
|
|
203
|
-
private :
|
|
174
|
+
private :analyze_newline
|
|
204
175
|
|
|
205
176
|
def edit_attrs_(elm, attr_name, attr_value)
|
|
206
177
|
if is_match("selected", attr_name) && is_match("option", elm.name)
|
|
@@ -228,7 +199,7 @@ module Meteor
|
|
|
228
199
|
@res = match_p.match(elm.attributes)
|
|
229
200
|
|
|
230
201
|
if !@res
|
|
231
|
-
# add
|
|
202
|
+
# add an attribute to attributes (属性文字列の最後に新規の属性を追加する)
|
|
232
203
|
if elm.attributes != ""
|
|
233
204
|
elm.attributes = String.new("") << " " << elm.attributes.strip
|
|
234
205
|
# else
|
|
@@ -236,12 +207,12 @@ module Meteor
|
|
|
236
207
|
|
|
237
208
|
elm.attributes << " " << replace_update
|
|
238
209
|
else
|
|
239
|
-
#
|
|
210
|
+
# replace attribute (属性の置換)
|
|
240
211
|
elm.attributes.gsub!(replace_regex, replace_update)
|
|
241
212
|
end
|
|
242
213
|
elsif false.equal?(attr_value) || is_match("false", attr_value)
|
|
243
214
|
# delete if attribute_name attrubute exeists (attr_name属性が存在するなら削除)
|
|
244
|
-
#
|
|
215
|
+
# replace attribute (属性の置換)
|
|
245
216
|
elm.attributes.gsub!(replace_regex, "")
|
|
246
217
|
end
|
|
247
218
|
end
|
|
@@ -338,69 +309,6 @@ module Meteor
|
|
|
338
309
|
end
|
|
339
310
|
|
|
340
311
|
private :get_attr_map
|
|
341
|
-
|
|
342
|
-
def escape(content)
|
|
343
|
-
# replace special character (特殊文字の置換)
|
|
344
|
-
content = content.gsub(@@pattern_escape, TABLE_FOR_ESCAPE_)
|
|
345
|
-
|
|
346
|
-
content
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
def escape_content(content, elm)
|
|
350
|
-
# replace special character (特殊文字の置換)
|
|
351
|
-
content = content.gsub(@@pattern_escape_content, TABLE_FOR_ESCAPE_CONTENT_)
|
|
352
|
-
|
|
353
|
-
content
|
|
354
|
-
end
|
|
355
|
-
|
|
356
|
-
private :escape
|
|
357
|
-
private :escape_content
|
|
358
|
-
|
|
359
|
-
def unescape(content)
|
|
360
|
-
# replace special character (特殊文字の置換)
|
|
361
|
-
# 「<」<-「<」
|
|
362
|
-
# 「>」<-「>」
|
|
363
|
-
# 「"」<-「"l」
|
|
364
|
-
# 「 」<-「 」
|
|
365
|
-
# 「&」<-「&」
|
|
366
|
-
content.gsub(@@pattern_unescape) do
|
|
367
|
-
case $1
|
|
368
|
-
when "amp"
|
|
369
|
-
"&"
|
|
370
|
-
when "quot"
|
|
371
|
-
"\""
|
|
372
|
-
when "apos"
|
|
373
|
-
"'"
|
|
374
|
-
when "gt"
|
|
375
|
-
">"
|
|
376
|
-
when "lt"
|
|
377
|
-
"<"
|
|
378
|
-
when "nbsp"
|
|
379
|
-
" "
|
|
380
|
-
end
|
|
381
|
-
end
|
|
382
|
-
|
|
383
|
-
content
|
|
384
|
-
end
|
|
385
|
-
|
|
386
|
-
private :unescape
|
|
387
|
-
|
|
388
|
-
def br_to_newline(content)
|
|
389
|
-
if (elm.cx || !is_match(@@match_tag_2, elm.name)) && content.include?(BR)
|
|
390
|
-
# 「<br>」->「¥r?¥n」
|
|
391
|
-
content.gsub!(@@pattern_br_2, @root.kaigyo_code)
|
|
392
|
-
end
|
|
393
|
-
end
|
|
394
|
-
|
|
395
|
-
def unescape_content(content, elm)
|
|
396
|
-
content_ = unescape(content)
|
|
397
|
-
|
|
398
|
-
br_to_newline(content_)
|
|
399
|
-
|
|
400
|
-
content_
|
|
401
|
-
end
|
|
402
|
-
|
|
403
|
-
private :unescape_content
|
|
404
312
|
end
|
|
405
313
|
end
|
|
406
314
|
end
|
|
@@ -76,7 +76,7 @@ module Meteor
|
|
|
76
76
|
# analyze document (ドキュメントをパースする)
|
|
77
77
|
#
|
|
78
78
|
def analyze_ml
|
|
79
|
-
|
|
79
|
+
analyze_newline
|
|
80
80
|
analyze_content_type
|
|
81
81
|
|
|
82
82
|
@res = nil
|
|
@@ -95,7 +95,7 @@ module Meteor
|
|
|
95
95
|
#
|
|
96
96
|
# analuze document , set newline (ドキュメントをパースし、改行コードをセットする)
|
|
97
97
|
#
|
|
98
|
-
def
|
|
98
|
+
def analyze_newline
|
|
99
99
|
for a in KAIGYO_CODE
|
|
100
100
|
if @root.document.include?(a)
|
|
101
101
|
@root.kaigyo_code = a
|
|
@@ -104,7 +104,7 @@ module Meteor
|
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
private :
|
|
107
|
+
private :analyze_newline
|
|
108
108
|
|
|
109
109
|
#
|
|
110
110
|
# analyze document , set content type (ドキュメントをパースし、コンテントタイプをセットする)
|
data/lib/meteor/parsers.rb
CHANGED
|
@@ -138,22 +138,22 @@ module Meteor
|
|
|
138
138
|
|
|
139
139
|
#
|
|
140
140
|
#@overload add(relative_path,enc)
|
|
141
|
-
#
|
|
141
|
+
# add parser (パーサを追加する)
|
|
142
142
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
143
143
|
# @param [String] enc character encoding (文字エンコーディング)
|
|
144
144
|
# @return [Meteor::Parser] parser (パーサ)
|
|
145
145
|
#@overload add(relative_path)
|
|
146
|
-
#
|
|
146
|
+
# add parser (パーサを追加する)
|
|
147
147
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
148
148
|
# @return [Meteor::Parser] parser (パーサ)
|
|
149
149
|
#@overload add(type,relative_path,enc)
|
|
150
|
-
#
|
|
150
|
+
# add parser (パーサを追加する)
|
|
151
151
|
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
152
152
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
153
153
|
# @param [String] enc character encoding (文字エンコーディング)
|
|
154
154
|
# @return [Meteor::Parser] parser (パーサ)
|
|
155
155
|
#@overload add(type,relative_path)
|
|
156
|
-
#
|
|
156
|
+
# add parser (パーサを追加する)
|
|
157
157
|
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
158
158
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
159
159
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -204,7 +204,7 @@ module Meteor
|
|
|
204
204
|
private :path_to_url
|
|
205
205
|
|
|
206
206
|
#
|
|
207
|
-
#
|
|
207
|
+
# add parser (パーサを追加する)
|
|
208
208
|
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
209
209
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
210
210
|
# @param [String] enc character encoding (文字エンコーディング)
|
|
@@ -221,7 +221,7 @@ module Meteor
|
|
|
221
221
|
private :add_3
|
|
222
222
|
|
|
223
223
|
#
|
|
224
|
-
#
|
|
224
|
+
# add parser (パーサを追加する)
|
|
225
225
|
# @param [Integer,Symbol] type type of parser(パーサ・タイプ)
|
|
226
226
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
227
227
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -233,7 +233,7 @@ module Meteor
|
|
|
233
233
|
private :add_2_n
|
|
234
234
|
|
|
235
235
|
#
|
|
236
|
-
#
|
|
236
|
+
# add parser (パーサを追加する)
|
|
237
237
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
238
238
|
# @param [String] enc character encoding (文字エンコーディング)
|
|
239
239
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -245,7 +245,7 @@ module Meteor
|
|
|
245
245
|
private :add_2_s
|
|
246
246
|
|
|
247
247
|
#
|
|
248
|
-
#
|
|
248
|
+
# add parser (パーサを追加する)
|
|
249
249
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
250
250
|
# @return [Meteor::Parser] parser (パーサ)
|
|
251
251
|
#
|
|
@@ -261,14 +261,14 @@ module Meteor
|
|
|
261
261
|
# @param [String,Symbol] key identifier (キー)
|
|
262
262
|
# @return [Meteor::Parser] parser (パーサ)
|
|
263
263
|
#@overload parser(type,relative_path,enc)
|
|
264
|
-
#
|
|
264
|
+
# add parser (パーサを追加する)
|
|
265
265
|
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
266
266
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
267
267
|
# @param [String] enc character encoding (エンコーディング)
|
|
268
268
|
# @return [Meteor::Parser] parser (パーサ)
|
|
269
269
|
# @deprecated
|
|
270
270
|
#@overload parser(type,relative_path)
|
|
271
|
-
#
|
|
271
|
+
# add parser (パーサを追加する)
|
|
272
272
|
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
273
273
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
274
274
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -317,13 +317,13 @@ module Meteor
|
|
|
317
317
|
|
|
318
318
|
#
|
|
319
319
|
# @overload add_str(type, relative_url, doc)
|
|
320
|
-
#
|
|
320
|
+
# add parser (パーサを追加する)
|
|
321
321
|
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
322
322
|
# @param [String] relative_url relative URL (相対URL)
|
|
323
323
|
# @param [String] doc document (ドキュメント)
|
|
324
324
|
# @return [Meteor::Parser] parser (パーサ)
|
|
325
325
|
# @overload add_str(relative_url, doc)
|
|
326
|
-
#
|
|
326
|
+
# add parser (パーサを追加する)
|
|
327
327
|
# @param [String] relative_url relative URL (相対URL)
|
|
328
328
|
# @param [String] doc document (ドキュメント)
|
|
329
329
|
# @return [Meteor::Parser] parser (パーサ)
|
|
@@ -340,7 +340,7 @@ module Meteor
|
|
|
340
340
|
end
|
|
341
341
|
|
|
342
342
|
#
|
|
343
|
-
#
|
|
343
|
+
# add parser (パーサを追加する)
|
|
344
344
|
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
345
345
|
# @param [String] relative_url relative URL (相対URL)
|
|
346
346
|
# @param [String] doc document (ドキュメント)
|
|
@@ -357,7 +357,7 @@ module Meteor
|
|
|
357
357
|
private :add_str_3
|
|
358
358
|
|
|
359
359
|
#
|
|
360
|
-
#
|
|
360
|
+
# add parser (パーサを追加する)
|
|
361
361
|
# @param [String] relative_url relative URL (相対URL)
|
|
362
362
|
# @param [String] doc document (ドキュメント)
|
|
363
363
|
# @return [Meteor::Parser] parser (パーサ)
|
data/lib/meteor.rb
CHANGED
|
@@ -36,11 +36,11 @@ require "meteor/ml/xml/parser_impl"
|
|
|
36
36
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
37
37
|
#
|
|
38
38
|
# @author Yasumasa Ashida
|
|
39
|
-
# @version 0.9.
|
|
39
|
+
# @version 0.9.23
|
|
40
40
|
#
|
|
41
41
|
|
|
42
42
|
module Meteor
|
|
43
|
-
VERSION = "0.9.
|
|
43
|
+
VERSION = "0.9.23"
|
|
44
44
|
|
|
45
45
|
# require 'fileutils'
|
|
46
46
|
|