meteor 0.9.8.5 → 0.9.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -1
- data/Gemfile.lock +18 -0
- data/README.md +7 -7
- data/demo/demo_html4.rb +1 -1
- data/demo/demo_html5.rb +4 -0
- data/demo/demo_xml.rb +5 -1
- data/lib/meteor.rb +12 -7
- data/meteor.gemspec +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 44f0769bd5122d05e1fa025620a663590e01682ed91f0df6a97ee16179991345
|
4
|
+
data.tar.gz: 76a7e658e3102717c1bc6447378a914c85ad82c96d091bd37506b622f1877e92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93acc94e943e01b72f093bdc89ec4cb30e4b66f4f60cf892884aafaf1de3c5a8276e3aa04b062623c1223e814431e6e21971eec512d1a6fc8a2dc0236626a593
|
7
|
+
data.tar.gz: d7930e3a667e9a6fd9f8edbaaca0d59498113c31d2a58682fc428e4f715b041825aeb9238cb0b9ab4f32a97736f42283209b3bdcd98fe839d855c2fc620e23a4
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Meteor
|
3
3
|
==================
|
4
|
-
A lightweight
|
4
|
+
A lightweight HTML & XML Parser
|
5
5
|
|
6
6
|
```shell
|
7
7
|
gem install meteor #gem installation
|
@@ -13,19 +13,19 @@ Meteor
|
|
13
13
|
```
|
14
14
|
|
15
15
|
## Explanation
|
16
|
-
This libarary is lightweight
|
16
|
+
This libarary is lightweight HTML parser.
|
17
17
|
This can use as XML parser.
|
18
18
|
This may be false parser.
|
19
19
|
|
20
|
-
This libarary doesn't support all of XML spec.
|
21
|
-
This supports a range of
|
20
|
+
This libarary doesn't support all of HTML & XML spec.
|
21
|
+
This supports a range of HTML & XML spec
|
22
22
|
thought to be the need routinely.
|
23
23
|
|
24
|
-
軽量(簡易?)
|
24
|
+
軽量(簡易?)HTMLパーサです。
|
25
25
|
XMLパーサとしても使用可能です。
|
26
26
|
パーサもどきかもしれません。
|
27
27
|
|
28
|
-
|
28
|
+
HTML、XMLの仕様の全てをサポートしてはいません、
|
29
29
|
日常的に必要と思われる範囲をサポートしています。
|
30
30
|
|
31
31
|
This doesn't convert the whole into objects but
|
@@ -54,4 +54,4 @@ Licensed under the LGPL V2.1.
|
|
54
54
|
Yasumasa Ashida (ys.ashida@gmail.com)
|
55
55
|
|
56
56
|
## Copyright
|
57
|
-
(c) 2008-
|
57
|
+
(c) 2008-2021 Yasumasa Ashida
|
data/demo/demo_html4.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#require 'rubygems'
|
5
5
|
require 'meteor'
|
6
6
|
|
7
|
-
#Meteor::ElementFactory.link(:
|
7
|
+
#Meteor::ElementFactory.link(:html4,'ml/sample_4.html', 'UTF-8')
|
8
8
|
Meteor::ElementFactory.options= {type: :html4}
|
9
9
|
Meteor::ElementFactory.link('ml/sample_4.html')
|
10
10
|
|
data/demo/demo_html5.rb
CHANGED
@@ -87,8 +87,12 @@ elms = root.elements('tr', id: 'loop')
|
|
87
87
|
#elms = root.elements('input', id: 'radio1', type: 'radio')
|
88
88
|
#elms = root.css('input[id=radio1][type=radio]')
|
89
89
|
elms.each{|elm|
|
90
|
+
puts '-------'
|
91
|
+
puts 'doc----'
|
90
92
|
puts elm.document
|
93
|
+
puts 'attrs--'
|
91
94
|
puts elm.attributes
|
95
|
+
puts 'mixed--'
|
92
96
|
puts elm.mixed_content
|
93
97
|
}
|
94
98
|
|
data/demo/demo_xml.rb
CHANGED
@@ -101,9 +101,13 @@ puts root.document
|
|
101
101
|
#elms = root.elements("potato")
|
102
102
|
|
103
103
|
elms = root.elements("test") #elms = root.css('test')
|
104
|
-
elms.each{|elm|
|
104
|
+
elms.each{|elm, i|
|
105
|
+
puts '-------'
|
106
|
+
puts 'doc----'
|
105
107
|
puts elm.document
|
108
|
+
puts 'attrs--'
|
106
109
|
puts elm.attributes
|
110
|
+
puts 'mixed--'
|
107
111
|
puts elm.mixed_content
|
108
112
|
}
|
109
113
|
|
data/lib/meteor.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -* coding: UTF-8 -*-
|
2
2
|
# Meteor - A lightweight (X)HTML(5) & XML parser
|
3
3
|
#
|
4
|
-
# Copyright (C) 2008-
|
4
|
+
# Copyright (C) 2008-2021 Yasumasa Ashida.
|
5
5
|
#
|
6
6
|
# This program is free software; you can redistribute it and/or modify
|
7
7
|
# it under the terms of the GNU Lesser General Public License as published by
|
@@ -18,12 +18,12 @@
|
|
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.
|
21
|
+
# @version 0.9.9.0
|
22
22
|
#
|
23
23
|
|
24
24
|
module Meteor
|
25
25
|
|
26
|
-
VERSION = '0.9.
|
26
|
+
VERSION = '0.9.9.0'.freeze
|
27
27
|
|
28
28
|
#require 'fileutils'
|
29
29
|
|
@@ -1931,6 +1931,7 @@ module Meteor
|
|
1931
1931
|
if @res[1]
|
1932
1932
|
element_without_1(name)
|
1933
1933
|
else
|
1934
|
+
#puts '---element_with_1'
|
1934
1935
|
element_with_1(name)
|
1935
1936
|
end
|
1936
1937
|
#else
|
@@ -1946,6 +1947,8 @@ module Meteor
|
|
1946
1947
|
@elm_ = Meteor::Element.new(name)
|
1947
1948
|
|
1948
1949
|
unless @on_search
|
1950
|
+
#puts '--on_search=false'
|
1951
|
+
#puts @res.to_a
|
1949
1952
|
#属性
|
1950
1953
|
@elm_.attributes = @res[2]
|
1951
1954
|
#内容
|
@@ -1953,6 +1956,7 @@ module Meteor
|
|
1953
1956
|
#全体
|
1954
1957
|
@elm_.document = @res[0]
|
1955
1958
|
else
|
1959
|
+
#puts '--on_search=true'
|
1956
1960
|
#属性
|
1957
1961
|
@elm_.attributes = @res[1]
|
1958
1962
|
#内容
|
@@ -3099,12 +3103,13 @@ module Meteor
|
|
3099
3103
|
|
3100
3104
|
@element_cache.store(@elm_.object_id, @elm_)
|
3101
3105
|
|
3102
|
-
@on_search = false
|
3103
3106
|
#else
|
3104
3107
|
# break
|
3105
3108
|
#end
|
3106
3109
|
end
|
3107
|
-
|
3110
|
+
|
3111
|
+
@on_search = false
|
3112
|
+
|
3108
3113
|
elm_arr
|
3109
3114
|
end
|
3110
3115
|
|
@@ -4676,7 +4681,7 @@ module Meteor
|
|
4676
4681
|
|
4677
4682
|
def escape(content)
|
4678
4683
|
#特殊文字の置換
|
4679
|
-
content.gsub
|
4684
|
+
content = content.gsub(@@pattern_escape, TABLE_FOR_ESCAPE_)
|
4680
4685
|
|
4681
4686
|
content
|
4682
4687
|
end
|
@@ -5116,7 +5121,7 @@ module Meteor
|
|
5116
5121
|
|
5117
5122
|
def escape(content)
|
5118
5123
|
#特殊文字の置換
|
5119
|
-
content.gsub
|
5124
|
+
content = content.gsub(@@pattern_escape, TABLE_FOR_ESCAPE_)
|
5120
5125
|
|
5121
5126
|
content
|
5122
5127
|
end
|
data/meteor.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features|demo)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~>
|
21
|
+
spec.add_development_dependency "bundler", "~> 2.2"
|
22
22
|
#spec.add_development_dependency "rake"
|
23
23
|
spec.has_rdoc = 'yard'
|
24
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meteor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yasumasa Ashida
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.2'
|
27
27
|
description: A lightweight (X)HTML(5) & XML parser
|
28
28
|
email: ys.ashida@gmail.com
|
29
29
|
executables: []
|
@@ -33,6 +33,7 @@ files:
|
|
33
33
|
- ".gitignore"
|
34
34
|
- ChangeLog
|
35
35
|
- Gemfile
|
36
|
+
- Gemfile.lock
|
36
37
|
- README.md
|
37
38
|
- Rakefile
|
38
39
|
- demo/demo_html4.rb
|
@@ -53,7 +54,7 @@ homepage: https://github.com/asip/meteor
|
|
53
54
|
licenses:
|
54
55
|
- LGPL-2.1
|
55
56
|
metadata: {}
|
56
|
-
post_install_message:
|
57
|
+
post_install_message:
|
57
58
|
rdoc_options: []
|
58
59
|
require_paths:
|
59
60
|
- lib
|
@@ -68,9 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
69
|
- !ruby/object:Gem::Version
|
69
70
|
version: '0'
|
70
71
|
requirements: []
|
71
|
-
|
72
|
-
|
73
|
-
signing_key:
|
72
|
+
rubygems_version: 3.2.3
|
73
|
+
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: A lightweight (X)HTML(5) & XML parser
|
76
76
|
test_files:
|