meteor 0.9.9.0 → 0.9.12
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/.gitignore +1 -1
- data/ChangeLog +4 -0
- data/README.md +10 -3
- data/Rakefile +1 -1
- data/demo/{demo_html5.rb → html.rb} +5 -4
- data/demo/{demo_html4.rb → html4.rb} +5 -4
- data/demo/ml/sample.xml +11 -11
- data/demo/ml/sample_html.html +32 -0
- data/demo/ml/sample_html4.html +40 -0
- data/demo/ml/sample_xhtml.html +33 -0
- data/demo/ml/sample_xhtml4.html +33 -0
- data/demo/{demo_xhtml5.rb → xhtml.rb} +6 -5
- data/demo/{demo_xhtml4.rb → xhtml4.rb} +5 -4
- data/demo/{demo_xml.rb → xml.rb} +1 -0
- data/lib/meteor.rb +477 -475
- data/meteor.gemspec +4 -3
- metadata +23 -26
- data/demo/ml/sample_4.html +0 -40
- data/demo/ml/sample_5.html +0 -32
- data/demo/ml/sample_x4.html +0 -33
- data/demo/ml/sample_x5.html +0 -33
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3102e1f48f286368f2a764f81d5d32c0d7599891e46d6404a15ec615f84df774
|
|
4
|
+
data.tar.gz: 9511b466cef335dbfaba6522c466c6196283f00483a3877a188f322ecefdbce5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57dc690b280ec1b278663e95452b537f1aea884f53c754bbeba667456a0075a3c8652f437f49392ea7e4b6ac16ed46ac06dc2f9b77c7510e86f7dbf20dd33841
|
|
7
|
+
data.tar.gz: cc326eb562f22d73882351d8769f7015ff37994a1bcc98c2273e86f38de2d07ff29fe28027b74f4f0459c092e9ce655f1fe26218f27c3d15c0983804e2015871
|
data/.gitignore
CHANGED
data/ChangeLog
CHANGED
data/README.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
Meteor
|
|
2
|
+
# Meteor
|
|
3
|
+
|
|
3
4
|
==================
|
|
4
5
|
A lightweight HTML & XML Parser
|
|
5
6
|
|
|
6
7
|
```shell
|
|
7
8
|
gem install meteor #gem installation
|
|
8
9
|
```
|
|
10
|
+
|
|
9
11
|
```shell
|
|
10
|
-
#archive installation
|
|
12
|
+
# archive installation
|
|
11
13
|
gem build meteor.gemspec
|
|
12
14
|
gem install meteor-*.gem
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
## Explanation
|
|
18
|
+
|
|
16
19
|
This libarary is lightweight HTML parser.
|
|
17
20
|
This can use as XML parser.
|
|
18
21
|
This may be false parser.
|
|
@@ -39,19 +42,23 @@ DOMのように全体をオブジェクトのツリー構造に変換するの
|
|
|
39
42
|
必要は全くありません。)
|
|
40
43
|
|
|
41
44
|
## API
|
|
45
|
+
|
|
42
46
|
http://rubydoc.info/github/asip/meteor/frames
|
|
43
47
|
|
|
44
48
|
## Gem
|
|
49
|
+
|
|
45
50
|
https://rubygems.org/gems/meteor
|
|
46
51
|
|
|
47
52
|
## Examples
|
|
53
|
+
|
|
48
54
|
https://github.com/asip/meteor/tree/master/demo
|
|
49
55
|
|
|
50
56
|
## License
|
|
57
|
+
|
|
51
58
|
Licensed under the LGPL V2.1.
|
|
52
59
|
|
|
53
60
|
## Author
|
|
54
61
|
Yasumasa Ashida (ys.ashida@gmail.com)
|
|
55
62
|
|
|
56
63
|
## Copyright
|
|
57
|
-
(c) 2008-
|
|
64
|
+
(c) 2008-2023 Yasumasa Ashida
|
data/Rakefile
CHANGED
|
@@ -60,7 +60,7 @@ spec = Gem::Specification.new do |s|
|
|
|
60
60
|
s.test_files = Dir["test/*_test.rb"]
|
|
61
61
|
|
|
62
62
|
#s.add_dependency('activesupport', '>=1.3.1')
|
|
63
|
-
#s.required_ruby_version = '>=
|
|
63
|
+
#s.required_ruby_version = '>= 3.0.0'
|
|
64
64
|
|
|
65
65
|
s.files = %w(README.md ChangeLog Rakefile) +
|
|
66
66
|
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
#!bin ruby
|
|
2
2
|
# -* coding: UTF-8 -*-
|
|
3
|
+
# frozen_string_literal: true
|
|
3
4
|
|
|
4
5
|
#require 'rubygems'
|
|
5
6
|
require 'meteor'
|
|
6
7
|
|
|
7
|
-
Meteor::ElementFactory.link(:
|
|
8
|
-
root = Meteor::ElementFactory.element('/ml/
|
|
8
|
+
Meteor::ElementFactory.link(:html,"ml/sample_html.html", 'UTF-8')
|
|
9
|
+
root = Meteor::ElementFactory.element('/ml/sample_html')
|
|
9
10
|
|
|
10
11
|
start_time = Time.new.to_f
|
|
11
12
|
|
|
12
13
|
elm_hello = root.element(id: 'hello')
|
|
13
|
-
elm_hello['
|
|
14
|
-
#elm_hello['
|
|
14
|
+
elm_hello['class'] = 'red' #elm_hello.attr(class: 'red')
|
|
15
|
+
#elm_hello['class'] = nil #elm_hello.remove_attr('class')
|
|
15
16
|
|
|
16
17
|
elm_hello2 = root.element(id: 'hello2')
|
|
17
18
|
elm_hello2.content = 'Hello,Tester' #elm_hello2.content('Hello,Tester')
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
#!bin ruby
|
|
2
2
|
# -* coding: UTF-8 -*-
|
|
3
|
+
# frozen_string_literal: true
|
|
3
4
|
|
|
4
5
|
#require 'rubygems'
|
|
5
6
|
require 'meteor'
|
|
6
7
|
|
|
7
8
|
#Meteor::ElementFactory.link(:html4,'ml/sample_4.html', 'UTF-8')
|
|
8
9
|
Meteor::ElementFactory.options= {type: :html4}
|
|
9
|
-
Meteor::ElementFactory.link('ml/
|
|
10
|
+
Meteor::ElementFactory.link('ml/sample_html4.html')
|
|
10
11
|
|
|
11
|
-
root = Meteor::ElementFactory.element('/ml/
|
|
12
|
+
root = Meteor::ElementFactory.element('/ml/sample_html4')
|
|
12
13
|
|
|
13
14
|
start_time = Time.new.to_f
|
|
14
15
|
|
|
15
16
|
elm_hello = root.element(id: 'hello')
|
|
16
|
-
elm_hello['
|
|
17
|
-
#elm_hello['
|
|
17
|
+
elm_hello['class'] = 'red' #elm_hello.attr(class: 'red')
|
|
18
|
+
#elm_hello['class'] = nil #elm_hello.remove_attr('class')
|
|
18
19
|
|
|
19
20
|
elm_hello2 = root.element(id: 'hello2')
|
|
20
21
|
elm_hello2.content = 'Hello,Tester' #elm_hello2.content('Hello,Tester')
|
data/demo/ml/sample.xml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
|
|
3
3
|
<!--
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Document : test.xml
|
|
5
|
+
Created on : 2008/07/22, 17:32
|
|
6
|
+
Author : asip
|
|
7
|
+
Description:
|
|
8
|
+
Purpose of the document follows.
|
|
9
9
|
-->
|
|
10
10
|
|
|
11
11
|
<root>
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
<test1 manbo="mango" />
|
|
14
14
|
|
|
15
15
|
<test manbo="manbo">
|
|
16
|
-
|
|
16
|
+
<tech mono="mono">こまねち</tech>
|
|
17
17
|
</test>
|
|
18
18
|
<test manbo="mbo">
|
|
19
|
-
|
|
19
|
+
<tech mono="mono">komaneti</tech>
|
|
20
20
|
</test>
|
|
21
21
|
<test manbo="mbo">
|
|
22
|
-
|
|
22
|
+
<tech mono="mono2">komaneti</tech>
|
|
23
23
|
</test>
|
|
24
24
|
<!-- @quark id="mono" --><!-- /@quark -->
|
|
25
25
|
<!-- @quark id="moti" --><!-- /@quark -->
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
<mink>komaneti</mink>
|
|
30
30
|
|
|
31
31
|
<potato id="aa" lc="/cc">
|
|
32
|
-
|
|
32
|
+
<potato id="/bb"></potato>
|
|
33
33
|
</potato>
|
|
34
34
|
|
|
35
35
|
<potato id="aa" id2="bb" lc="/cc">
|
|
36
|
-
|
|
36
|
+
<potato id="/bb"><test></test></potato>
|
|
37
37
|
</potato>
|
|
38
38
|
|
|
39
39
|
<potato2 id="aa" id2="bb" lc="/cc"/>
|
|
40
40
|
|
|
41
41
|
<hamachi id="aa" id2="bb" lc="/cc">
|
|
42
|
-
|
|
42
|
+
test
|
|
43
43
|
</hamachi>
|
|
44
44
|
|
|
45
45
|
<hamachi id="aa" id2="bb" />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<html lang="ja">
|
|
2
|
+
<head>
|
|
3
|
+
<title>HTMLテスト</title>
|
|
4
|
+
<meta http-equiv="Content-Type" charset="utf-8" content="text/html; charset=UTF-8">
|
|
5
|
+
</head>
|
|
6
|
+
|
|
7
|
+
<body>
|
|
8
|
+
<div id="hello" class="black">Hello,World</div>
|
|
9
|
+
<div id="hello2">Hello,World</div>
|
|
10
|
+
<!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
|
|
11
|
+
<form>
|
|
12
|
+
<input id="text1" name="text1" type="text">
|
|
13
|
+
|
|
14
|
+
<input id="radio1" type="radio">
|
|
15
|
+
|
|
16
|
+
<select name="select1">
|
|
17
|
+
<option id="option1">オプション</option>
|
|
18
|
+
</select>
|
|
19
|
+
|
|
20
|
+
<select id="select2">
|
|
21
|
+
<option id="option2">オプション</option>
|
|
22
|
+
</select>
|
|
23
|
+
</form>
|
|
24
|
+
|
|
25
|
+
<table>
|
|
26
|
+
<tr id="loop">
|
|
27
|
+
<td id="aa"></td><td id="bb"></td><td id="cc"></td>
|
|
28
|
+
</tr>
|
|
29
|
+
</table>
|
|
30
|
+
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<html lang="ja">
|
|
2
|
+
<head>
|
|
3
|
+
<title>HTMLテスト</title>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
5
|
+
</head>
|
|
6
|
+
|
|
7
|
+
<body>
|
|
8
|
+
<div id="hello" class="black">Hello,World</div>
|
|
9
|
+
<div id="hello2">Hello,World</div>
|
|
10
|
+
<!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
|
|
11
|
+
<form>
|
|
12
|
+
<input id="text1" type="text" >
|
|
13
|
+
|
|
14
|
+
<input id="radio1" type="radio" class="test">
|
|
15
|
+
|
|
16
|
+
<select id="select1">
|
|
17
|
+
<option id="option1">オプション</option>
|
|
18
|
+
</select>
|
|
19
|
+
|
|
20
|
+
<select id="select2">
|
|
21
|
+
<option id="option2">オプション</option>
|
|
22
|
+
</select>
|
|
23
|
+
</form>
|
|
24
|
+
|
|
25
|
+
<table>
|
|
26
|
+
<tr id="loop">
|
|
27
|
+
<td id="aa"></td><td id="bb"></td><td id="cc"></td>
|
|
28
|
+
</tr>
|
|
29
|
+
</table>
|
|
30
|
+
|
|
31
|
+
<div id="sample" style="background-color: aliceblue;" >
|
|
32
|
+
<div>test</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="sample2" style="background-color: aliceblue;" class="test">
|
|
36
|
+
<div>test</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
</body>
|
|
40
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<html lang="ja">
|
|
3
|
+
<head>
|
|
4
|
+
<title>HTMLテスト</title>
|
|
5
|
+
<meta http-equiv="Content-Type" charset="utf-8" content="text/html; charset=UTF-8"/>
|
|
6
|
+
</head>
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<div id="hello" class="black">Hello,World</div>
|
|
10
|
+
<div id="hello2">Hello,World</div>
|
|
11
|
+
<!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
|
|
12
|
+
<form>
|
|
13
|
+
<input id="text1" type="text" />
|
|
14
|
+
|
|
15
|
+
<input id="radio1" type="radio" />
|
|
16
|
+
|
|
17
|
+
<select>
|
|
18
|
+
<option id="option1">オプション</option>
|
|
19
|
+
</select>
|
|
20
|
+
|
|
21
|
+
<select id="select2">
|
|
22
|
+
<option id="option2">オプション</option>
|
|
23
|
+
</select>
|
|
24
|
+
</form>
|
|
25
|
+
|
|
26
|
+
<table>
|
|
27
|
+
<tr id="loop">
|
|
28
|
+
<td id="aa"></td><td id="bb"></td><td id="cc"></td>
|
|
29
|
+
</tr>
|
|
30
|
+
</table>
|
|
31
|
+
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<html lang="ja">
|
|
3
|
+
<head>
|
|
4
|
+
<title>HTMLテスト</title>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
6
|
+
</head>
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<div id="hello" class="black">Hello,World</div>
|
|
10
|
+
<div id="hello2">Hello,World</div>
|
|
11
|
+
<!-- @quark id="hello3" -->Hello,World<!-- /@quark -->
|
|
12
|
+
<form>
|
|
13
|
+
<input id="text1" type="text" />
|
|
14
|
+
|
|
15
|
+
<input id="radio1" type="radio" />
|
|
16
|
+
|
|
17
|
+
<select>
|
|
18
|
+
<option id="option1">オプション</option>
|
|
19
|
+
</select>
|
|
20
|
+
|
|
21
|
+
<select id="select2">
|
|
22
|
+
<option id="option2">オプション</option>
|
|
23
|
+
</select>
|
|
24
|
+
</form>
|
|
25
|
+
|
|
26
|
+
<table>
|
|
27
|
+
<tr id="loop">
|
|
28
|
+
<td id="aa"></td><td id="bb"></td><td id="cc"></td>
|
|
29
|
+
</tr>
|
|
30
|
+
</table>
|
|
31
|
+
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
#!bin ruby
|
|
2
2
|
# -* coding: UTF-8 -*-
|
|
3
|
+
# frozen_string_literal: true
|
|
3
4
|
|
|
4
5
|
#require 'rubygems'
|
|
5
6
|
require 'meteor'
|
|
6
7
|
|
|
7
|
-
Meteor::ElementFactory.link(:
|
|
8
|
-
root = Meteor::ElementFactory.element('/ml/
|
|
8
|
+
Meteor::ElementFactory.link(:xhtml,'ml/sample_xhtml.html', 'UTF-8')
|
|
9
|
+
root = Meteor::ElementFactory.element('/ml/sample_xhtml')
|
|
9
10
|
|
|
10
11
|
startTime = Time.new.to_f
|
|
11
12
|
|
|
12
13
|
elm_hello = root.element(id: 'hello')
|
|
13
|
-
elm_hello['
|
|
14
|
-
#elm_hello['
|
|
15
|
-
#elm_hello.attr(
|
|
14
|
+
elm_hello['class'] = 'red' #elm_hello.attr(class: "red")
|
|
15
|
+
#elm_hello['class'] = nil #elm_hello.remove_attr('class')
|
|
16
|
+
#elm_hello.attr(class: nil)
|
|
16
17
|
|
|
17
18
|
elm_hello2 = root.element(id: 'hello2')
|
|
18
19
|
elm_hello2.content = "Hello,Tester" #elm_hello2.content("Hello,Tester")
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
#!bin ruby
|
|
2
2
|
# -* coding: UTF-8 -*-
|
|
3
|
+
# frozen_string_literal: true
|
|
3
4
|
|
|
4
5
|
#require 'rubygems'
|
|
5
6
|
require 'meteor'
|
|
6
7
|
|
|
7
|
-
Meteor::ElementFactory.link(:xhtml4,'ml/
|
|
8
|
-
root = Meteor::ElementFactory.element('/ml/
|
|
8
|
+
Meteor::ElementFactory.link(:xhtml4,'ml/sample_xhtml4.html', 'UTF-8')
|
|
9
|
+
root = Meteor::ElementFactory.element('/ml/sample_xhtml4')
|
|
9
10
|
|
|
10
11
|
startTime = Time.new.to_f
|
|
11
12
|
|
|
12
13
|
elm_hello = root.element("id","hello")
|
|
13
|
-
elm_hello['
|
|
14
|
-
#elm_hello['
|
|
14
|
+
elm_hello['class'] = 'red' #elm_hello.attr(class: "red")
|
|
15
|
+
#elm_hello['class'] = nil #elm_hello.remove_attr('class')
|
|
15
16
|
|
|
16
17
|
elm_hello2 = root.element(id: "hello2")
|
|
17
18
|
elm_hello2.content = "Hello,Tester" #elm_hello2.content("Hello,Tester")
|