meteor 0.9.13 → 0.9.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88fad5c6e441dad9f62db837cb68812b78ad2b92ddebf69a07027e2c497fa880
4
- data.tar.gz: 3eb96c0e72a512a3b41f9acf9014d46c80f1f206183d5ca785440fe520468126
3
+ metadata.gz: 5edd4d31b61edd52eee6adb3f61784e54140d28216ada36e7ce2b0f66e02b0c1
4
+ data.tar.gz: a5e1729d16467baf211cd96d6876f8d307c03bc27e56dfc462fd7356a6a17484
5
5
  SHA512:
6
- metadata.gz: 3b368f523ca876c85b3f2e90d89af9f31fe3a828e15cbdcf4ba1c714454ac9e3075f03ae06c0b3240a10b9aa2a92597adb608c878da27b9859b1f7d74981a8e5
7
- data.tar.gz: b1526787c25b9645d3e51ce914837b4919f0ccc1a116feb0a25fbac6e6eff88bbbba3c189aa38aae433511309b299ea1f1ffe21f413293dba98512c8ce2704c4
6
+ metadata.gz: 0424f42f10572ead20fe1f1ffd368f1a001b9bac5e607af725508a2c51262bf9ca1f8be35e28ee62b70381f6422284aa504fe145c8cb913c9771ce52931ee277
7
+ data.tar.gz: 74fb101b38d37e03a30919724bd348e71c8a10c481f609bcb35055f17bccd1fe47b73cbf6acc7044b30ae7a84972075c49c1668c657bbf502e666eb33c666d0a
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.9.14 / 2026-06-17 Yasumasa Ashida <ys.ashida@gmail.com>
2
+
3
+ * Fix the content-type handling in the parsers
4
+
1
5
  == 0.9.13 / 2026-05-31 Yasumasa Ashida <ys.ashida@gmail.com>
2
6
 
3
7
  * Refactoring
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meteor (0.9.12)
4
+ meteor (0.9.13)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -11,8 +11,8 @@ PLATFORMS
11
11
  ruby
12
12
 
13
13
  DEPENDENCIES
14
- bundler (~> 2.2)
14
+ bundler (~> 4.0.11)
15
15
  meteor!
16
16
 
17
17
  BUNDLED WITH
18
- 4.0.11
18
+ 4.0.11
data/demo/html.rb CHANGED
@@ -3,24 +3,29 @@
3
3
  # frozen_string_literal: true
4
4
 
5
5
  # require 'rubygems'
6
- require 'meteor'
6
+ require "meteor"
7
7
 
8
- Meteor::ElementFactory.link(:html,"ml/sample_html.html", 'UTF-8')
9
- root = Meteor::ElementFactory.element('/ml/sample_html')
8
+ Meteor::ElementFactory.link(:html, "ml/sample_html.html", "UTF-8")
9
+ root = Meteor::ElementFactory.element("/ml/sample_html")
10
10
 
11
11
  start_time = Time.new.to_f
12
12
 
13
- elm_hello = root.element(id: 'hello')
14
- elm_hello['class'] = 'red' # elm_hello.attr(class: 'red')
13
+ elm_hello = root.element(id: "hello")
14
+ # elm_hello.attr(class: 'red')
15
+ elm_hello["class"] = "red"
15
16
  # elm_hello['class'] = nil # elm_hello.remove_attr('class')
16
17
 
17
- elm_hello2 = root.element(id: 'hello2')
18
- elm_hello2.content = 'Hello,Tester' # elm_hello2.content('Hello,Tester')
18
+ elm_hello2 = root.element(id: "hello2")
19
+ # elm_hello2.content('Hello,Tester')
20
+ elm_hello2.content = "Hello,Tester"
19
21
 
20
- elm_text1 = root.element(id: 'text1')
21
- elm_text1['value'] = 'めも' # elm_text1.attr(value: めも')
22
- elm_text1['disabled'] = true # elm_text1.attr(disabled: true)
23
- elm_text1['required'] = true # elm_text1.attr(required: true)
22
+ elm_text1 = root.element(id: "text1")
23
+ # elm_text1.attr(value: めも')
24
+ elm_text1["value"] = "めも"
25
+ # elm_text1.attr(disabled: true)
26
+ elm_text1["disabled"] = true
27
+ # elm_text1.attr(required: true)
28
+ elm_text1["required"] = true
24
29
 
25
30
  # elm_text1['disabled'] = nil # elm_text1.remove_attr('disabled')
26
31
  # map = elm_text1.attr_map
@@ -44,30 +49,35 @@ elm_text1['required'] = true # elm_text1.attr(required: true)
44
49
  # puts elm_option1['selected'] # puts elm_option1.attr('selected')
45
50
  # puts elm_text1['readonly'] # puts elm_text1.attr('readonly')
46
51
 
47
- elm_select2 = root.element('select',id: 'select2')
48
- elm_select2['multiple'] = true
49
- elm_option2 = elm_select2.element('option',id: 'option2')
50
- co_elm = elm_option2.element()
52
+ elm_select2 = root.element("select", id: "select2")
53
+ elm_select2["multiple"] = true
54
+ elm_option2 = elm_select2.element("option", id: "option2")
55
+ co_elm = elm_option2.element
51
56
  10.times { |i|
52
- co_elm['value'] = i # co_elm.attr(value: i)
57
+ # co_elm.attr(value: i)
58
+ co_elm["value"] = i
53
59
  # '<' +
54
- if i == 1 then
55
- co_elm['selected'] = true # co_elm.attr(selected: true)
60
+ if i == 1
61
+ # co_elm.attr(selected: true)
62
+ co_elm["selected"] = true
56
63
  else
57
- co_elm['selected'] = false # co_elm.attr(selected: false)
64
+ # co_elm.attr(selected: false)
65
+ co_elm["selected"] = false
58
66
  end
59
- co_elm.content = i # co_elm.content(i)
60
- co_elm['id'] = nil # co_elm.remove_attr('id')
67
+ # co_elm.content(i)
68
+ co_elm.content = i
69
+ # co_elm.remove_attr('id')
70
+ co_elm["id"] = nil
61
71
  co_elm.flash
62
72
  }
63
73
 
64
- elm_tr1 = root.element('tr',id: 'loop')
74
+ elm_tr1 = root.element("tr", id: "loop")
65
75
  elm_ = root.element(elm_tr1)
66
- elm_dt1_ = elm_.element(id: 'aa')
67
- elm_dt2_ = elm_.element(id: 'bb')
68
- elm_dt3_ = elm_.element(id: 'cc')
76
+ elm_dt1_ = elm_.element(id: "aa")
77
+ elm_dt2_ = elm_.element(id: "bb")
78
+ elm_dt3_ = elm_.element(id: "cc")
69
79
  10.times do |i|
70
- elm_['loop'] = i
80
+ elm_["loop"] = i
71
81
  elm_dt1 = elm_dt1_.clone
72
82
  elm_dt2 = elm_dt2_.clone
73
83
  elm_dt3 = elm_dt3_.clone
@@ -82,22 +92,22 @@ root.flash
82
92
 
83
93
  end_time = Time.new.to_f
84
94
 
85
- puts root.document
95
+ puts(root.document)
86
96
 
87
- elms = root.elements('tr', id: 'loop')
97
+ elms = root.elements("tr", id: "loop")
88
98
  # elms = root.elements('input', id: 'radio1', type: 'radio')
89
99
  # elms = root.css('input[id=radio1][type=radio]')
90
- elms.each{|elm|
91
- puts '-------'
92
- puts 'doc----'
93
- puts elm.document
94
- puts 'attrs--'
95
- puts elm.attributes
96
- puts 'mixed--'
97
- puts elm.mixed_content
100
+ elms.each { |elm|
101
+ puts("-------")
102
+ puts("doc----")
103
+ puts(elm.document)
104
+ puts("attrs--")
105
+ puts(elm.attributes)
106
+ puts("mixed--")
107
+ puts(elm.mixed_content)
98
108
  }
99
109
 
100
- puts "charset:#{root.charset}"
101
- puts "content-type:#{root.content_type}"
110
+ puts("charset:#{root.charset}")
111
+ puts("content-type:#{root.content_type}")
102
112
 
103
- puts '' + (end_time - start_time).to_s + ' sec'
113
+ puts("" + (end_time - start_time).to_s + " sec")
data/demo/html4.rb CHANGED
@@ -3,22 +3,24 @@
3
3
  # frozen_string_literal: true
4
4
 
5
5
  # require 'rubygems'
6
- require 'meteor'
6
+ require "meteor"
7
7
 
8
8
  # Meteor::ElementFactory.link(:html4,'ml/sample_4.html', 'UTF-8')
9
- Meteor::ElementFactory.options= {type: :html4}
10
- Meteor::ElementFactory.link('ml/sample_html4.html')
9
+ Meteor::ElementFactory.options = {type: :html4}
10
+ Meteor::ElementFactory.link("ml/sample_html4.html")
11
11
 
12
- root = Meteor::ElementFactory.element('/ml/sample_html4')
12
+ root = Meteor::ElementFactory.element("/ml/sample_html4")
13
13
 
14
14
  start_time = Time.new.to_f
15
15
 
16
- elm_hello = root.element(id: 'hello')
17
- elm_hello['class'] = 'red' # elm_hello.attr(class: 'red')
16
+ elm_hello = root.element(id: "hello")
17
+ # elm_hello.attr(class: 'red')
18
+ elm_hello["class"] = "red"
18
19
  # elm_hello['class'] = nil # elm_hello.remove_attr('class')
19
20
 
20
- elm_hello2 = root.element(id: 'hello2')
21
- elm_hello2.content = 'Hello,Tester' # elm_hello2.content('Hello,Tester')
21
+ elm_hello2 = root.element(id: "hello2")
22
+ # elm_hello2.content('Hello,Tester')
23
+ elm_hello2.content = "Hello,Tester"
22
24
 
23
25
  # elm_hello3 = root.cxtag('hello3')
24
26
  # elm_hello3.content = "Hello,Hello\ntt" # elm_hello3.content = "Hello,Hello"
@@ -28,11 +30,11 @@ elm_hello2.content = 'Hello,Tester' # elm_hello2.content('Hello,Tester')
28
30
  # puts elm_hello3.content
29
31
  # puts elm_hello3.mixed_content
30
32
 
31
- elm_text1 = root.element('input', id: 'text1')
33
+ elm_text1 = root.element("input", id: "text1")
32
34
  # elm_text1['value'] = 'めも' # elm_text1.attr(value: 'めも')
33
35
  # elm_text1.attr = {value: 'メモ'}
34
36
  # elm_text1['disabled'] = true # elm_text1.attr(disabled: true)
35
- elm_text1.attrs = {value: 'メモ', disabled: true, readonly: true}
37
+ elm_text1.attrs = {value: "メモ", disabled: true, readonly: true}
36
38
  # puts elm_text1.attrs
37
39
  # elm_text1['disabled'] = nil # elm_text1.remove_attr('disabled')
38
40
  # map = elm_text1.attr_map
@@ -60,31 +62,36 @@ elm_text1.attrs = {value: 'メモ', disabled: true, readonly: true}
60
62
  # puts elm_option1['selected'] # puts elm_option1.attr('selected')
61
63
  # puts elm_text1['readonly'] # puts elm_text1.attr('readonly')
62
64
 
63
-
64
- elm_select2 = root.element('select', id: 'select2')
65
- elm_select2['multiple'] = true
66
- elm_option2 = elm_select2.element('option',id: 'option2')
67
- co_elm = elm_option2.element()
65
+ elm_select2 = root.element("select", id: "select2")
66
+ elm_select2["multiple"] = true
67
+ elm_option2 = elm_select2.element("option", id: "option2")
68
+ co_elm = elm_option2.element
68
69
  10.times { |i|
69
- co_elm['value'] = i # co_elm.attr(value: i)
70
+ # co_elm.attr(value: i)
71
+ co_elm["value"] = i
70
72
  # '<' +
71
- if i == 1 then
72
- co_elm['selected'] = true # co_elm.attr(selected: 'true')
73
+ if i == 1
74
+ # co_elm.attr(selected: 'true')
75
+ co_elm["selected"] = true
73
76
  else
74
- co_elm['selected'] = false # co_elm.attr(selected: 'false')
77
+ # co_elm.attr(selected: 'false')
78
+ co_elm["selected"] = false
75
79
  end
76
- co_elm.content = i # co_elm.content(i)
77
- co_elm['id'] = nil # co_elm.remove_attr('id')
80
+ # co_elm.content(i)
81
+ co_elm.content = i
82
+ # co_elm.remove_attr('id')
83
+ co_elm["id"] = nil
78
84
  co_elm.flash
79
85
  }
80
86
 
81
- elm_tr1 = root.element('tr',id: 'loop') # elm_tr1 = root.css('tr[id=loop]')
87
+ # elm_tr1 = root.css('tr[id=loop]')
88
+ elm_tr1 = root.element("tr", id: "loop")
82
89
  elm_ = root.element(elm_tr1)
83
- elm_dt1_ = elm_.element(id: 'aa')
84
- elm_dt2_ = elm_.element(id: 'bb')
85
- elm_dt3_ = elm_.element(id: 'cc')
90
+ elm_dt1_ = elm_.element(id: "aa")
91
+ elm_dt2_ = elm_.element(id: "bb")
92
+ elm_dt3_ = elm_.element(id: "cc")
86
93
  10.times do |i|
87
- elm_['loop'] = i
94
+ elm_["loop"] = i
88
95
  elm_dt1 = elm_dt1_.clone
89
96
  elm_dt2 = elm_dt2_.clone
90
97
  elm_dt3 = elm_dt3_.clone
@@ -95,20 +102,20 @@ elm_dt3_ = elm_.element(id: 'cc')
95
102
  elm_.flash
96
103
  end
97
104
 
98
- elms = root.elements(id: 'sample')
105
+ elms = root.elements(id: "sample")
99
106
  # elms = root.css('div') # elms = root.css('div[class=test]')
100
107
 
101
- elms.each_with_index{ |elm_,i|
102
- elm_['style'] = i.to_s
108
+ elms.each_with_index { |elm_, i|
109
+ elm_["style"] = i.to_s
103
110
  }
104
111
 
105
112
  root.flash
106
113
 
107
114
  end_time = Time.new.to_f
108
115
 
109
- puts root.document
116
+ puts(root.document)
110
117
 
111
- puts "charset:#{root.charset}"
112
- puts "content-type:#{root.content_type}"
118
+ puts("charset:#{root.charset}")
119
+ puts("content-type:#{root.content_type}")
113
120
 
114
- puts '' + (end_time - start_time).to_s + ' sec'
121
+ puts("" + (end_time - start_time).to_s + " sec")
data/demo/ml/sample.xml CHANGED
@@ -9,42 +9,40 @@
9
9
  -->
10
10
 
11
11
  <root>
12
-
13
- <test1 manbo="mango" />
14
-
15
- <test manbo="manbo">
16
- <tech mono="mono">こまねち</tech>
17
- </test>
18
- <test manbo="mbo">
19
- <tech mono="mono">komaneti</tech>
20
- </test>
21
- <test manbo="mbo">
22
- <tech mono="mono2">komaneti</tech>
23
- </test>
24
- <!-- @quark id="mono" --><!-- /@quark -->
25
- <!-- @quark id="moti" --><!-- /@quark -->
26
- <momo>komaneti</momo>
27
- <kobe momo="mono">komaneti</kobe>
28
- <teo a="aa" b="bb"/>
29
- <mink>komaneti</mink>
30
-
31
- <potato id="aa" lc="/cc">
32
- <potato id="/bb"></potato>
33
- </potato>
34
-
35
- <potato id="aa" id2="bb" lc="/cc">
36
- <potato id="/bb"><test></test></potato>
37
- </potato>
38
-
39
- <potato2 id="aa" id2="bb" lc="/cc"/>
40
-
41
- <hamachi id="aa" id2="bb" lc="/cc">
42
- test
43
- </hamachi>
44
-
45
- <hamachi id="aa" id2="bb" />
46
-
47
- <kobe momo="momo" value="komaneti" />
48
- <!-- @pp id="cs" -->テスト<!-- /@pp -->
49
-
12
+ <test1 manbo="mango" />
13
+
14
+ <test manbo="manbo">
15
+ <tech mono="mono">こまねち</tech>
16
+ </test>
17
+ <test manbo="mbo">
18
+ <tech mono="mono">komaneti</tech>
19
+ </test>
20
+ <test manbo="mbo">
21
+ <tech mono="mono2">komaneti</tech>
22
+ </test>
23
+ <!-- @quark id="mono" --><!-- /@quark -->
24
+ <!-- @quark id="moti" --><!-- /@quark -->
25
+ <momo>komaneti</momo>
26
+ <kobe momo="mono">komaneti</kobe>
27
+ <teo a="aa" b="bb"/>
28
+ <mink>komaneti</mink>
29
+
30
+ <potato id="aa" lc="/cc">
31
+ <potato id="/bb"></potato>
32
+ </potato>
33
+
34
+ <potato id="aa" id2="bb" lc="/cc">
35
+ <potato id="/bb"><test></test></potato>
36
+ </potato>
37
+
38
+ <potato2 id="aa" id2="bb" lc="/cc"/>
39
+
40
+ <hamachi id="aa" id2="bb" lc="/cc">
41
+ test
42
+ </hamachi>
43
+
44
+ <hamachi id="aa" id2="bb" />
45
+
46
+ <kobe momo="momo" value="komaneti" />
47
+ <!-- @pp id="cs" -->テスト<!-- /@pp -->
50
48
  </root>
@@ -6,28 +6,33 @@
6
6
  </head>
7
7
 
8
8
  <body>
9
+ <h1>HTMLテスト</h1>
9
10
  <div id="hello" class="black">Hello,World</div>
10
11
  <div id="hello2">Hello,World</div>
11
12
  <!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
12
13
  <form>
13
- <input id="text1" name="text1" type="text">
14
+ <label for="text1">text1</label>
15
+ <input type="text" id="text1" name="text1" value="">
14
16
 
17
+ <label for="radio1">radio1</label>
15
18
  <input id="radio1" name="radio1" type="radio">
16
19
 
20
+ <label for="select1">select1</label>
17
21
  <select id="select1" name="select1">
18
22
  <option id="option1">オプション</option>
19
23
  </select>
20
24
 
25
+ <label for="select2">select2</label>
21
26
  <select id="select2" name="select2">
22
27
  <option id="option2">オプション</option>
23
28
  </select>
24
29
  </form>
25
30
 
26
31
  <table>
32
+ <caption>table1</caption>
27
33
  <tr id="loop">
28
34
  <td id="aa"></td><td id="bb"></td><td id="cc"></td>
29
35
  </tr>
30
36
  </table>
31
-
32
37
  </body>
33
38
  </html>
@@ -1,28 +1,36 @@
1
+ <!DOCTYPE html>
1
2
  <html lang="ja">
2
3
  <head>
3
- <title>HTMLテスト</title>
4
+ <title>HTML4テスト</title>
4
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
+ <meta charset="UTF-8"/>
5
7
  </head>
6
8
 
7
9
  <body>
10
+ <h1>HTML4テスト</h1>
8
11
  <div id="hello" class="black">Hello,World</div>
9
12
  <div id="hello2">Hello,World</div>
10
13
  <!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
11
14
  <form>
15
+ <label for="text1">text1</label>
12
16
  <input id="text1" name="text1" type="text" >
13
17
 
18
+ <label for="radio1">radio1</label>
14
19
  <input id="radio1" name="radio1" type="radio" class="test">
15
20
 
21
+ <label for="select1">select1</label>
16
22
  <select id="select1" name="select1">
17
23
  <option id="option1">オプション</option>
18
24
  </select>
19
25
 
26
+ <label for="select2">select2</label>
20
27
  <select id="select2" name="select2">
21
28
  <option id="option2">オプション</option>
22
29
  </select>
23
30
  </form>
24
31
 
25
32
  <table>
33
+ <caption>table</caption>
26
34
  <tr id="loop">
27
35
  <td id="aa"></td><td id="bb"></td><td id="cc"></td>
28
36
  </tr>
@@ -35,6 +43,5 @@
35
43
  <div id="sample2" style="background-color: aliceblue;" class="test">
36
44
  <div>test</div>
37
45
  </div>
38
-
39
46
  </body>
40
47
  </html>
@@ -2,33 +2,38 @@
2
2
  <?xml version="1.0" encoding="UTF-8"?>
3
3
  <html lang="ja">
4
4
  <head>
5
- <title>HTMLテスト</title>
5
+ <title>XHTMLテスト</title>
6
6
  <meta charset="UTF-8"/>
7
7
  </head>
8
8
 
9
9
  <body>
10
+ <h1>XHTMLテスト</h1>
10
11
  <div id="hello" class="black">Hello,World</div>
11
12
  <div id="hello2">Hello,World</div>
12
13
  <!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
13
14
  <form>
15
+ <label for="text1">text1</label>
14
16
  <input id="text1" name="text1" type="text" />
15
17
 
18
+ <label for="radio1">radio1</label>
16
19
  <input id="radio1" name="radio1" type="radio" />
17
20
 
21
+ <label for="select1">select1</label>
18
22
  <select id="select1" name="select1">
19
23
  <option id="option1">オプション</option>
20
24
  </select>
21
25
 
26
+ <label for="select2">select2</label>
22
27
  <select id="select2" name="select2">
23
28
  <option id="option2">オプション</option>
24
29
  </select>
25
30
  </form>
26
31
 
27
32
  <table>
33
+ <caption>table</caption>
28
34
  <tr id="loop">
29
35
  <td id="aa"></td><td id="bb"></td><td id="cc"></td>
30
36
  </tr>
31
37
  </table>
32
-
33
38
  </body>
34
39
  </html>
@@ -1,33 +1,40 @@
1
+ <!DOCTYPE html>
1
2
  <?xml version="1.0" encoding="UTF-8"?>
2
3
  <html lang="ja">
3
4
  <head>
4
- <title>HTMLテスト</title>
5
+ <title>XHTML4テスト</title>
5
6
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
7
+ <meta charset="UTF-8"/>
6
8
  </head>
7
9
 
8
10
  <body>
11
+ <h1>XHTML4テスト</h1>
9
12
  <div id="hello" class="black">Hello,World</div>
10
13
  <div id="hello2">Hello,World</div>
11
14
  <!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
12
15
  <form>
16
+ <label for="text1">text1</label>
13
17
  <input id="text1" name="text1" type="text" />
14
18
 
19
+ <label for="radio1">radio1</label>
15
20
  <input id="radio1" name="radio1" type="radio" />
16
21
 
17
- <select>
22
+ <label for="select1">select1</label>
23
+ <select id="select1" name="select1">
18
24
  <option id="option1">オプション</option>
19
25
  </select>
20
26
 
27
+ <label for="select2">select2</label>
21
28
  <select id="select2" name="select2">
22
29
  <option id="option2">オプション</option>
23
30
  </select>
24
31
  </form>
25
32
 
26
33
  <table>
34
+ <caption>table</caption>
27
35
  <tr id="loop">
28
36
  <td id="aa"></td><td id="bb"></td><td id="cc"></td>
29
37
  </tr>
30
38
  </table>
31
-
32
39
  </body>
33
40
  </html>