meteor 0.9.17 → 0.9.19
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 +9 -0
- data/Gemfile.lock +1 -1
- data/demo/html.rb +2 -2
- data/demo/html4.rb +8 -8
- data/demo/xhtml.rb +3 -3
- data/demo/xhtml4.rb +1 -1
- data/demo/xml.rb +2 -2
- data/lib/meteor/core/kernel.rb +7 -21
- data/lib/meteor/core/util/pattern_cache.rb +2 -2
- data/lib/meteor/element.rb +0 -2
- data/lib/meteor/elements.rb +5 -5
- data/lib/meteor/ml/html4/parser_impl.rb +1 -1
- data/lib/meteor/ml/xhtml/parser_impl.rb +3 -3
- data/lib/meteor/ml/xhtml4/parser_impl.rb +2 -2
- 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: a5cd092814ce42dc2c43a909cdaba66fdade6e6c843478ac090aac5a2d4f487e
|
|
4
|
+
data.tar.gz: f48b7cb7e1e159bd6f94d77a7140219a7f5e323812bd072a8368261fc3459200
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0689acb2f048912e05a831f94977c45239c5b35cfca707c2eaf8313956452fdc397d897e93ff7005e4944815145c13e77747c90af029d5d16985de43890c9944'
|
|
7
|
+
data.tar.gz: 850cbdc875e5845b5cd1bd424b27759d2e2ee4fb3515c86019234940371ee147f2e40ff8a3982460f195b963e9ae0b1137e0ad595919c863461861c9a8bdc19d
|
data/ChangeLog
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
== 0.9.19 / 2026-06-20 Yasumasa Ashida <ys.ashida@gmail.com>
|
|
2
|
+
|
|
3
|
+
* Refactoring
|
|
4
|
+
|
|
5
|
+
== 0.9.18 / 2026-06-20 Yasumasa Ashida <ys.ashida@gmail.com>
|
|
6
|
+
|
|
7
|
+
* Fixnum → Integer
|
|
8
|
+
* Refactoring
|
|
9
|
+
|
|
1
10
|
== 0.9.17 / 2026-06-19 Yasumasa Ashida <ys.ashida@gmail.com>
|
|
2
11
|
|
|
3
12
|
* Refactoring
|
data/Gemfile.lock
CHANGED
data/demo/html.rb
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# require 'rubygems'
|
|
6
6
|
require "meteor"
|
|
7
7
|
|
|
8
|
-
Meteor::Elements.add(:html, "ml/sample_html.html"
|
|
8
|
+
Meteor::Elements.add(:html, "ml/sample_html.html")
|
|
9
9
|
root = Meteor::Elements.get("/ml/sample_html")
|
|
10
10
|
|
|
11
11
|
start_time = Time.new.to_f
|
|
@@ -13,7 +13,7 @@ start_time = Time.new.to_f
|
|
|
13
13
|
elm_hello = root.element(id: "hello")
|
|
14
14
|
# elm_hello.attr(class: 'red')
|
|
15
15
|
elm_hello["class"] = "red"
|
|
16
|
-
# elm_hello['class'] = nil
|
|
16
|
+
# elm_hello['class'] = nil # elm_hello.remove_attr('class')
|
|
17
17
|
|
|
18
18
|
elm_hello2 = root.element(id: "hello2")
|
|
19
19
|
# elm_hello2.content('Hello,Tester')
|
data/demo/html4.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
require "meteor"
|
|
7
7
|
|
|
8
8
|
# Meteor::Elements.add(:html4,'ml/sample_4.html', 'UTF-8')
|
|
9
|
-
Meteor::Elements.options = {type: :html4}
|
|
9
|
+
Meteor::Elements.options = { type: :html4 }
|
|
10
10
|
Meteor::Elements.add("ml/sample_html4.html")
|
|
11
11
|
|
|
12
12
|
root = Meteor::Elements.get("/ml/sample_html4")
|
|
@@ -31,12 +31,12 @@ elm_hello2.content = "Hello,Tester"
|
|
|
31
31
|
# puts elm_hello3.mixed_content
|
|
32
32
|
|
|
33
33
|
elm_text1 = root.element("input", id: "text1")
|
|
34
|
-
# elm_text1['value'] = 'めも'
|
|
35
|
-
# elm_text1.attr = {value: 'メモ'}
|
|
36
|
-
# elm_text1['disabled'] = true
|
|
37
|
-
elm_text1.attrs = {value: "メモ", disabled: true, readonly: true}
|
|
34
|
+
# elm_text1['value'] = 'めも' # elm_text1.attr(value: 'めも')
|
|
35
|
+
# elm_text1.attr = { value: 'メモ' }
|
|
36
|
+
# elm_text1['disabled'] = true. # elm_text1.attr(disabled: true)
|
|
37
|
+
elm_text1.attrs = { value: "メモ", disabled: true, readonly: true }
|
|
38
38
|
# puts elm_text1.attrs
|
|
39
|
-
# elm_text1['disabled'] = nil
|
|
39
|
+
# elm_text1['disabled'] = nil # elm_text1.remove_attr('disabled')
|
|
40
40
|
# map = elm_text1.attr_map
|
|
41
41
|
# map.names.each { |item|
|
|
42
42
|
# puts item
|
|
@@ -46,9 +46,9 @@ elm_text1.attrs = {value: "メモ", disabled: true, readonly: true}
|
|
|
46
46
|
# elm_radio1 = root.element('input', id: 'radio1', type: 'radio')
|
|
47
47
|
## elm_radio1 = root.css('input[id=radio1][type=radio]')
|
|
48
48
|
## elm_radio1 = root.css('# radio1') # elm_radio1 = root.css('input# radio1')
|
|
49
|
-
## elm_radio1 = root.css('.test')
|
|
49
|
+
## elm_radio1 = root.css('.test') # elm_radio1 = root.css('input.test')
|
|
50
50
|
## elm_radio1 = root.css('[id=radio1][type=radio]')
|
|
51
|
-
# elm_radio1['checked'] = true
|
|
51
|
+
# elm_radio1['checked'] = true # elm_radio1.attr(checked: true)
|
|
52
52
|
# puts elm_radio1.document
|
|
53
53
|
|
|
54
54
|
# elm_select1 = root.element('select', id: 'select1')
|
data/demo/xhtml.rb
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# require 'rubygems'
|
|
6
6
|
require "meteor"
|
|
7
7
|
|
|
8
|
-
Meteor::Elements.add(:xhtml, "ml/sample_xhtml.html"
|
|
8
|
+
Meteor::Elements.add(:xhtml, "ml/sample_xhtml.html")
|
|
9
9
|
root = Meteor::Elements.get("/ml/sample_xhtml")
|
|
10
10
|
|
|
11
11
|
startTime = Time.new.to_f
|
|
@@ -13,7 +13,7 @@ startTime = Time.new.to_f
|
|
|
13
13
|
elm_hello = root.element(id: "hello")
|
|
14
14
|
# elm_hello.attr(class: "red")
|
|
15
15
|
elm_hello["class"] = "red"
|
|
16
|
-
# elm_hello['class'] = nil
|
|
16
|
+
# elm_hello['class'] = nil # elm_hello.remove_attr('class')
|
|
17
17
|
# elm_hello.attr(class: nil)
|
|
18
18
|
|
|
19
19
|
elm_hello2 = root.element(id: "hello2")
|
|
@@ -40,7 +40,7 @@ elm_text1["required"] = true
|
|
|
40
40
|
# }
|
|
41
41
|
|
|
42
42
|
# elm_radio1 = root.element("input",id: "radio1", type: "radio")
|
|
43
|
-
# elm_radio1['checked'] = true
|
|
43
|
+
# elm_radio1['checked'] = true # elm_radio1.attr(checked: true)
|
|
44
44
|
|
|
45
45
|
# elm_select1 = root.element("select",id: "select1")
|
|
46
46
|
# elm_select1 = root.element("select")
|
data/demo/xhtml4.rb
CHANGED
|
@@ -13,7 +13,7 @@ startTime = Time.new.to_f
|
|
|
13
13
|
elm_hello = root.element("id", "hello")
|
|
14
14
|
# elm_hello.attr(class: "red")
|
|
15
15
|
elm_hello["class"] = "red"
|
|
16
|
-
# elm_hello['class'] = nil
|
|
16
|
+
# elm_hello['class'] = nil # elm_hello.remove_attr('class')
|
|
17
17
|
|
|
18
18
|
elm_hello2 = root.element(id: "hello2")
|
|
19
19
|
# elm_hello2.content("Hello,Tester")
|
data/demo/xml.rb
CHANGED
data/lib/meteor/core/kernel.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Meteor
|
|
|
8
8
|
# @!attribute [rw] element_cache
|
|
9
9
|
# @return [Hash] element cache (要素キャッシュ)
|
|
10
10
|
# @!attribute [rw] doc_type
|
|
11
|
-
# @return [
|
|
11
|
+
# @return [Integer] document type (ドキュメントタイプ)
|
|
12
12
|
# @!attribute [rw] document_hook
|
|
13
13
|
# @return [String] hook document (フック・ドキュメント)
|
|
14
14
|
# @!attribute [rw] element_hook
|
|
@@ -124,7 +124,6 @@ module Meteor
|
|
|
124
124
|
# @param [String] enc character encoding of input file (入力ファイルの文字コード)
|
|
125
125
|
#
|
|
126
126
|
def read(file_path, enc)
|
|
127
|
-
|
|
128
127
|
# try {
|
|
129
128
|
@character_encoding = enc
|
|
130
129
|
# open file (ファイルのオープン)
|
|
@@ -253,13 +252,11 @@ module Meteor
|
|
|
253
252
|
if @elm_
|
|
254
253
|
@element_cache.store(@elm_.object_id, @elm_)
|
|
255
254
|
end
|
|
256
|
-
|
|
257
255
|
when TWO
|
|
258
256
|
element_4(elm.to_s, attrs.to_s, args[0].to_s, args[1])
|
|
259
257
|
if @elm_
|
|
260
258
|
@element_cache.store(@elm_.object_id, @elm_)
|
|
261
259
|
end
|
|
262
|
-
|
|
263
260
|
when THREE
|
|
264
261
|
element_5(elm.to_s, attrs.to_s, args[0], args[1].to_s, args[2])
|
|
265
262
|
if @elm_
|
|
@@ -281,7 +278,7 @@ module Meteor
|
|
|
281
278
|
# @return [Meteor::Element] element(要素)
|
|
282
279
|
#
|
|
283
280
|
def element_1(name)
|
|
284
|
-
|
|
281
|
+
quote_name(name)
|
|
285
282
|
|
|
286
283
|
# element search pattern (要素検索用パターン)
|
|
287
284
|
@pattern_cc = "<#{@_name}(|\\s[^<>]*)\\/>|<#{@_name}((?:|\\s[^<>]*))>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
|
|
@@ -578,8 +575,8 @@ module Meteor
|
|
|
578
575
|
# document (全体)
|
|
579
576
|
@elm_.document = @res[0]
|
|
580
577
|
# pattern (空要素検索用パターン)
|
|
581
|
-
@pattern_cc = String.new("") << "<" << @_name << "(\\s[^<>]*" << @_attr_name << "=\"" << @_attr_value << closer
|
|
582
|
-
|
|
578
|
+
# @pattern_cc = String.new("") << "<" << @_name << "(\\s[^<>]*" << @_attr_name << "=\"" << @_attr_value << closer
|
|
579
|
+
@pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}#{closer}"
|
|
583
580
|
@elm_.pattern = @pattern_cc
|
|
584
581
|
@elm_.parser = self
|
|
585
582
|
|
|
@@ -825,7 +822,6 @@ module Meteor
|
|
|
825
822
|
# @return [Meteor::Element] element (要素)
|
|
826
823
|
#
|
|
827
824
|
def element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
828
|
-
|
|
829
825
|
quote_element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
830
826
|
|
|
831
827
|
@pattern_cc_1 = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)\\/>|<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
|
|
@@ -881,7 +877,7 @@ module Meteor
|
|
|
881
877
|
private :element_5
|
|
882
878
|
|
|
883
879
|
def quote_element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
|
|
884
|
-
|
|
880
|
+
quote_name(name)
|
|
885
881
|
@_attr_name1 = Regexp.quote(attr_name1)
|
|
886
882
|
@_attr_name2 = Regexp.quote(attr_name2)
|
|
887
883
|
@_attr_value1 = Regexp.quote(attr_value1)
|
|
@@ -959,7 +955,6 @@ module Meteor
|
|
|
959
955
|
private :element_with_5_1
|
|
960
956
|
|
|
961
957
|
def element_with_5_2
|
|
962
|
-
|
|
963
958
|
element_pattern_with_5_2
|
|
964
959
|
|
|
965
960
|
if @sbuf.length == ZERO || @cnt != ZERO
|
|
@@ -1088,7 +1083,6 @@ module Meteor
|
|
|
1088
1083
|
private :quote_element_4
|
|
1089
1084
|
|
|
1090
1085
|
def element_pattern_4
|
|
1091
|
-
|
|
1092
1086
|
# @pattern_cc = String.new('') << '<([^<>"]*)\\s([^<>]*(' << @_attr_name1 << '="'
|
|
1093
1087
|
# @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
|
|
1094
1088
|
# @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
|
|
@@ -1458,7 +1452,6 @@ module Meteor
|
|
|
1458
1452
|
nil
|
|
1459
1453
|
end
|
|
1460
1454
|
end
|
|
1461
|
-
|
|
1462
1455
|
when 2
|
|
1463
1456
|
if selector[0] == "["
|
|
1464
1457
|
if @res = @@pattern_find_4.match(selector)
|
|
@@ -1509,7 +1502,6 @@ module Meteor
|
|
|
1509
1502
|
remove_attr(elm, attr.to_s)
|
|
1510
1503
|
end
|
|
1511
1504
|
end
|
|
1512
|
-
|
|
1513
1505
|
elsif attr.kind_of?(Hash) && attr.size == 1
|
|
1514
1506
|
if attr.values[0] != nil
|
|
1515
1507
|
elm.document_sync = true
|
|
@@ -1547,7 +1539,6 @@ module Meteor
|
|
|
1547
1539
|
private :set_attribute_3
|
|
1548
1540
|
|
|
1549
1541
|
def edit_attrs_(elm, attr_name, attr_value)
|
|
1550
|
-
|
|
1551
1542
|
# attribute search (属性検索)
|
|
1552
1543
|
# @res = @pattern.match(elm.attributes)
|
|
1553
1544
|
|
|
@@ -1591,7 +1582,6 @@ module Meteor
|
|
|
1591
1582
|
private :get_attr_value
|
|
1592
1583
|
|
|
1593
1584
|
def get_attr_value_(elm, attr_name)
|
|
1594
|
-
|
|
1595
1585
|
# attribute search pattern (属性検索用パターン)
|
|
1596
1586
|
@pattern = Meteor::Core::Util::PatternCache.get(String.new("") << attr_name << "=\"([^\"]*)\"")
|
|
1597
1587
|
# @pattern = Meteor::Core::Util::PatternCache.get("#{attr_name}=\"([^\"]*)\"")
|
|
@@ -1888,7 +1878,6 @@ module Meteor
|
|
|
1888
1878
|
if @elm_
|
|
1889
1879
|
@element_cache.store(@elm_.object_id, @elm_)
|
|
1890
1880
|
end
|
|
1891
|
-
|
|
1892
1881
|
when TWO
|
|
1893
1882
|
cxtag_2(args[0].to_s, args[1].to_s)
|
|
1894
1883
|
if @elm_
|
|
@@ -1906,10 +1895,10 @@ module Meteor
|
|
|
1906
1895
|
# @return [Meteor::Element] element (要素)
|
|
1907
1896
|
#
|
|
1908
1897
|
def cxtag_2(name, id)
|
|
1909
|
-
|
|
1898
|
+
quote_name(name)
|
|
1910
1899
|
@_id = Regexp.quote(id)
|
|
1911
1900
|
|
|
1912
|
-
# CX tag search pattern
|
|
1901
|
+
# CX tag search pattern (CXタグ検索用パターン)
|
|
1913
1902
|
# @pattern_cc = String.new('') << "<!--\\s@" << @_name << '\\s([^<>]*id="'
|
|
1914
1903
|
# @pattern_cc << id << '"[^<>]*)-->(((?!(<!--\\s/@' << @_name << ")).)*)<!--\\s/@" << @_name << "\\s-->"
|
|
1915
1904
|
# @pattern_cc = "<!--\\s@#{tag}\\s([^<>]*id=\"#{id}\"[^<>]*)-->(((?!(<!--\\s\\/@#{tag})).)*)<!--\\s\\/@#{tag}\\s-->"
|
|
@@ -1951,7 +1940,6 @@ module Meteor
|
|
|
1951
1940
|
# @return [Meteor::Element] element (要素)
|
|
1952
1941
|
#
|
|
1953
1942
|
def cxtag_1(id)
|
|
1954
|
-
|
|
1955
1943
|
@_id = Regexp.quote(id)
|
|
1956
1944
|
|
|
1957
1945
|
@pattern_cc = String.new("") << "<!--\\s@([^<>]*)\\s[^<>]*id=\"" << @_id << "\""
|
|
@@ -2020,7 +2008,6 @@ module Meteor
|
|
|
2020
2008
|
private :edit_document_1
|
|
2021
2009
|
|
|
2022
2010
|
def edit_document_2(elm, closer)
|
|
2023
|
-
|
|
2024
2011
|
# replace tag (タグ置換)
|
|
2025
2012
|
@pattern = Meteor::Core::Util::PatternCache.get(elm.pattern)
|
|
2026
2013
|
@root.document.sub!(@pattern, elm.document)
|
|
@@ -2032,7 +2019,6 @@ module Meteor
|
|
|
2032
2019
|
# reflect (反映する)
|
|
2033
2020
|
#
|
|
2034
2021
|
def flash
|
|
2035
|
-
|
|
2036
2022
|
if self.element_hook
|
|
2037
2023
|
if self.element_hook.origin.mono
|
|
2038
2024
|
if self.element_hook.origin.cx
|
|
@@ -23,7 +23,7 @@ module Meteor
|
|
|
23
23
|
# @return [Regexp] pattern (パターン)
|
|
24
24
|
# @overload get(regex,option)
|
|
25
25
|
# @param [String] regex regular expression (正規表現)
|
|
26
|
-
# @param [
|
|
26
|
+
# @param [Integer] option option of Regex (オプション)
|
|
27
27
|
# @return [Regexp] pattern (パターン)
|
|
28
28
|
#
|
|
29
29
|
def self.get(*args)
|
|
@@ -78,7 +78,7 @@ module Meteor
|
|
|
78
78
|
##
|
|
79
79
|
## パターンを取得する
|
|
80
80
|
## @param [String] regex 正規表現
|
|
81
|
-
## @param [
|
|
81
|
+
## @param [Integer] option オプション
|
|
82
82
|
## @return [Regexp] パターン
|
|
83
83
|
##
|
|
84
84
|
# def self.get_2(regex, option)
|
data/lib/meteor/element.rb
CHANGED
|
@@ -76,7 +76,6 @@ module Meteor
|
|
|
76
76
|
else
|
|
77
77
|
raise ArgumentError
|
|
78
78
|
end
|
|
79
|
-
|
|
80
79
|
when Meteor::TWO
|
|
81
80
|
@name = args[0].name
|
|
82
81
|
@attributes = String.new(args[0].attributes)
|
|
@@ -214,7 +213,6 @@ module Meteor
|
|
|
214
213
|
# @document = "<#{@name}#{@attributes}>"
|
|
215
214
|
end
|
|
216
215
|
end
|
|
217
|
-
|
|
218
216
|
when Parser::XHTML, Parser::XHTML4, Parser::XML
|
|
219
217
|
if @cx
|
|
220
218
|
# @pattern_cc = String.new('') << '<!-- @' << elm.name << ' ' << elm.attributes << '-->' << elm.mixed_content << '<!-- /@' << elm.name << ' -->'
|
data/lib/meteor/elements.rb
CHANGED
|
@@ -15,8 +15,8 @@ module Meteor
|
|
|
15
15
|
# @option @deprecated opts [String] :base_dir root directory (基準ディレクトリ)
|
|
16
16
|
# @option opts [String] :enc default character encoding (デフォルト文字エンコーディング)
|
|
17
17
|
# @option @deprecated opts [String] :base_enc default character encoding (デフォルト文字エンコーディング)
|
|
18
|
-
# @option opts [
|
|
19
|
-
# @option @deprecated opts [
|
|
18
|
+
# @option opts [Integer,Symbol] :type default type of parser (デフォルトのパーサ・タイプ)
|
|
19
|
+
# @option @deprecated opts [Integer | Symbol] :base_type default type of parser (デフォルトのパーサ・タイプ)
|
|
20
20
|
#
|
|
21
21
|
def self.options=(opts)
|
|
22
22
|
@@pf.options = opts
|
|
@@ -25,13 +25,13 @@ module Meteor
|
|
|
25
25
|
#
|
|
26
26
|
#@overload add(type,relative_path,enc)
|
|
27
27
|
# generate parser (パーサを作成する)
|
|
28
|
-
# @param [
|
|
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
|
# generate parser (パーサを作成する)
|
|
34
|
-
# @param [
|
|
34
|
+
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
35
35
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
36
36
|
# @return [Meteor::Parser] parser (パーサ)
|
|
37
37
|
#
|
|
@@ -42,7 +42,7 @@ module Meteor
|
|
|
42
42
|
#
|
|
43
43
|
# @overload add_str(type, relative_url, doc)
|
|
44
44
|
# generate parser (パーサを作成する)
|
|
45
|
-
# @param [
|
|
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 (パーサ)
|
|
@@ -23,7 +23,7 @@ module Meteor
|
|
|
23
23
|
#[Array] non-nestable elements (入れ子にできない要素)
|
|
24
24
|
@@match_tag_sng = ["texarea", "select", "option", "form", "fieldset"]
|
|
25
25
|
|
|
26
|
-
#[Array] boolean
|
|
26
|
+
#[Array] boolean attributes (論理値で指定する属性)
|
|
27
27
|
@@attr_logic = ["disabled", "readonly", "checked", "selected", "multiple"]
|
|
28
28
|
|
|
29
29
|
# DISABLE_ELEMENT = "input|textarea|select|optgroup"
|
|
@@ -8,13 +8,13 @@ module Meteor
|
|
|
8
8
|
# XHTML parser (XHTMLパーサ)
|
|
9
9
|
#
|
|
10
10
|
class ParserImpl < Meteor::Ml::Xhtml4::ParserImpl
|
|
11
|
-
#[Array] 論理値で指定する属性
|
|
11
|
+
#[Array] boolean attributes (論理値で指定する属性)
|
|
12
12
|
ATTR_LOGIC = ["disabled", "readonly", "checked", "selected", "multiple", "required"]
|
|
13
13
|
|
|
14
|
-
#[Array] disabled属性のある要素
|
|
14
|
+
#[Array] elements with the disabled attribute (disabled属性のある要素)
|
|
15
15
|
DISABLE_ELEMENT = ["input", "textarea", "select", "optgroup", "fieldset"]
|
|
16
16
|
|
|
17
|
-
#[Array] required属性のある要素
|
|
17
|
+
#[Array] elements with a readonly attribute (required属性のある要素)
|
|
18
18
|
REQUIRE_ELEMENT = ["input", "textarea"]
|
|
19
19
|
|
|
20
20
|
REQUIRED_M = "\\srequired=\"[^\"]*\"\\s|\\srequired=\"[^\"]*\"$"
|
|
@@ -17,14 +17,14 @@ module Meteor
|
|
|
17
17
|
#[Array] 改行を<br/>に変換する必要のない要素
|
|
18
18
|
@@match_tag_2 = ["textarea", "option", "pre"]
|
|
19
19
|
|
|
20
|
-
#[Array] 論理値で指定する属性
|
|
20
|
+
#[Array] boolean attributes (論理値で指定する属性)
|
|
21
21
|
@@attr_logic = ["disabled", "readonly", "checked", "selected", "multiple"]
|
|
22
22
|
|
|
23
23
|
# DISABLE_ELEMENT = "input|textarea|select|optgroup"
|
|
24
24
|
#[Array] element with disablled attribute (disabled属性のある要素)
|
|
25
25
|
DISABLE_ELEMENT = ["input", "textarea", "select", "optgroup"]
|
|
26
26
|
# READONLY_TYPE = "text|password"
|
|
27
|
-
#[Array] readonly属性のあるinput要素のタイプ
|
|
27
|
+
#[Array] the type of an input element with a readonly attribute (readonly属性のあるinput要素のタイプ)
|
|
28
28
|
READONLY_TYPE = ["text", "password"]
|
|
29
29
|
|
|
30
30
|
SELECTED_M = "\\sselected=\"[^\"]*\"\\s|\\sselected=\"[^\"]*\"$"
|
data/lib/meteor/parsers.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Meteor
|
|
|
6
6
|
# Parser Factory Class (パーサ・ファクトリ クラス)
|
|
7
7
|
#
|
|
8
8
|
# @!attribute [rw] type
|
|
9
|
-
# @return [
|
|
9
|
+
# @return [Integer,Symbol] default type of parser (デフォルトのパーサ・タイプ)
|
|
10
10
|
# @!attribute [rw] root
|
|
11
11
|
# @return [String] root root directory (基準ディレクトリ)
|
|
12
12
|
# @!attribute [rw] enc
|
|
@@ -36,7 +36,7 @@ module Meteor
|
|
|
36
36
|
# @param [String] root root directory (基準ディレクトリ)
|
|
37
37
|
# @param [String] enc default character encoding (デフォルトエンコーディング)
|
|
38
38
|
# @overload initialize(type, root, enc)
|
|
39
|
-
# @param [
|
|
39
|
+
# @param [Integer,Symbol] type default type of parser (デフォルトのパーサ・タイプ)
|
|
40
40
|
# @param [String] root root directory (基準ディレクトリ)
|
|
41
41
|
# @param [String] enc default character encoding (デフォルト文字エンコーディング)
|
|
42
42
|
#
|
|
@@ -89,7 +89,7 @@ module Meteor
|
|
|
89
89
|
|
|
90
90
|
#
|
|
91
91
|
# イニシャライザ
|
|
92
|
-
# @param [
|
|
92
|
+
# @param [Integer,Symbol] type default type of parser (デフォルトのパーサ・タイプ)
|
|
93
93
|
# @param [String] root root directory (基準ディレクトリ)
|
|
94
94
|
# @param [String] enc default character encoding (デフォルト文字エンコーディング)
|
|
95
95
|
#
|
|
@@ -109,8 +109,8 @@ module Meteor
|
|
|
109
109
|
# @option @deprecated opts [String] :base_dir root directory (基準ディレクトリ)
|
|
110
110
|
# @option opts [String] :enc default character encoding (デフォルト文字エンコーディング)
|
|
111
111
|
# @option @deprecated opts [String] :base_enc default character encoding (デフォルト文字エンコーディング)
|
|
112
|
-
# @option opts [
|
|
113
|
-
# @option @deprecated opts [
|
|
112
|
+
# @option opts [Integer,Symbol] :type default type of parser (デフォルトのパーサ・タイプ)
|
|
113
|
+
# @option @deprecated opts [Integer | Symbol] :base_type default type of parser (デフォルトのパーサ・タイプ)
|
|
114
114
|
#
|
|
115
115
|
def options=(opts)
|
|
116
116
|
if opts.kind_of?(Hash)
|
|
@@ -148,13 +148,13 @@ module Meteor
|
|
|
148
148
|
# @return [Meteor::Parser] parser (パーサ)
|
|
149
149
|
#@overload add(type,relative_path,enc)
|
|
150
150
|
# generate parser (パーサを作成する)
|
|
151
|
-
# @param [
|
|
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
|
# generate parser (パーサを作成する)
|
|
157
|
-
# @param [
|
|
157
|
+
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
158
158
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
159
159
|
# @return [Meteor::Parser] parser (パーサ)
|
|
160
160
|
#
|
|
@@ -163,7 +163,7 @@ module Meteor
|
|
|
163
163
|
when 1
|
|
164
164
|
add_1(args[0])
|
|
165
165
|
when 2
|
|
166
|
-
if args[0].kind_of?(
|
|
166
|
+
if args[0].kind_of?(Integer) || args[0].kind_of?(Symbol)
|
|
167
167
|
add_2_n(args[0], args[1])
|
|
168
168
|
elsif args[0].kind_of?(String)
|
|
169
169
|
add_2_s(args[0], args[1])
|
|
@@ -205,7 +205,7 @@ module Meteor
|
|
|
205
205
|
|
|
206
206
|
#
|
|
207
207
|
# generate parser (パーサを作成する)
|
|
208
|
-
# @param [
|
|
208
|
+
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
209
209
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
210
210
|
# @param [String] enc character encoding (文字エンコーディング)
|
|
211
211
|
# @return [Meteor::Parser] parser(パーサ)
|
|
@@ -222,7 +222,7 @@ module Meteor
|
|
|
222
222
|
|
|
223
223
|
#
|
|
224
224
|
# generate parser (パーサを作成する)
|
|
225
|
-
# @param [
|
|
225
|
+
# @param [Integer,Symbol] type type of parser(パーサ・タイプ)
|
|
226
226
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
227
227
|
# @return [Meteor::Parser] parser (パーサ)
|
|
228
228
|
#
|
|
@@ -262,14 +262,14 @@ module Meteor
|
|
|
262
262
|
# @return [Meteor::Parser] parser (パーサ)
|
|
263
263
|
#@overload parser(type,relative_path,enc)
|
|
264
264
|
# generate parser (パーサを作成する)
|
|
265
|
-
# @param [
|
|
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
|
# generate parser (パーサを作成する)
|
|
272
|
-
# @param [
|
|
272
|
+
# @param [Integer] type type of parser (パーサ・タイプ)
|
|
273
273
|
# @param [String] relative_path relative file path (相対ファイルパス)
|
|
274
274
|
# @return [Meteor::Parser] parser (パーサ)
|
|
275
275
|
# @deprecated
|
|
@@ -318,7 +318,7 @@ module Meteor
|
|
|
318
318
|
#
|
|
319
319
|
# @overload add_str(type, relative_url, doc)
|
|
320
320
|
# generate parser (パーサを作成する)
|
|
321
|
-
# @param [
|
|
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 (パーサ)
|
|
@@ -341,7 +341,7 @@ module Meteor
|
|
|
341
341
|
|
|
342
342
|
#
|
|
343
343
|
# generate parser (パーサを作成する)
|
|
344
|
-
# @param [
|
|
344
|
+
# @param [Integer,Symbol] type type of parser (パーサ・タイプ)
|
|
345
345
|
# @param [String] relative_url relative URL (相対URL)
|
|
346
346
|
# @param [String] doc document (ドキュメント)
|
|
347
347
|
# @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.19
|
|
40
40
|
#
|
|
41
41
|
|
|
42
42
|
module Meteor
|
|
43
|
-
VERSION = "0.9.
|
|
43
|
+
VERSION = "0.9.19"
|
|
44
44
|
|
|
45
45
|
# require 'fileutils'
|
|
46
46
|
|