meteor 0.9.37 → 0.9.39

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: fd24e160dd8ebd42f87b6305122d0dd287d96b3c44b2ab3c16a17170b967ae6f
4
- data.tar.gz: ef330abcca5a835e3e8371688bd28638895e54845cb1c0137db17ee69257ec45
3
+ metadata.gz: 8c2662781c5b67592210d563d198cb97f845e490782d09ad48d90d5f78b4a687
4
+ data.tar.gz: 4b351ff296228212f69749c5fd759f60cd7e680b6912c02c8b165bb8d821febf
5
5
  SHA512:
6
- metadata.gz: 12d65f04b18888dd403ae5e2399edf5c34bfa4db91ae3d65d0538533aec072c5ab1a40e3067dc8482b0a7dd6aaae7888e8b0396a86f4dc6312fc93203872c712
7
- data.tar.gz: 8063860a96ac60fa30d314bda48c91ccb1b5af4fb058a5c995a3aaa1e0338e601545bbcc6a9013c40dd9dbd16a3b15d247074a87b9f3bd23033678582acb6a93
6
+ metadata.gz: ab9dd8444e3366acfe6ae67d07da1d41d771f7da7c5f0fa821763eb52f0e3deb84037c4f68270a6f3a9020f04c9c44d869bbac50ac8b164a19f225ba60b9d17d
7
+ data.tar.gz: 02c05a7d823e1fc36e8d1561f2c91aa51ae725f45647ef1742479d7c52bfc748226778d9340e794d14b4c4ec82425732b01b98babdac729a9626b0bfa35bf419
data/ChangeLog CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.9.39 / 2026-07-09 Yasumasa Ashida <ys.ashida@gmail.com>
2
+
3
+ * Refactor Meteor::Parsers
4
+
5
+ == 0.9.38 / 2026-07-08 Yasumasa Ashida <ys.ashida@gmail.com>
6
+
7
+ * Refactor Meteor::Ml::(Html4|Xhtml4|Xml)::ParserImpl
8
+
1
9
  == 0.9.37 / 2026-07-08 Yasumasa Ashida <ys.ashida@gmail.com>
2
10
 
3
11
  * Refactor Meteor::Core::Kernel
data/Gemfile CHANGED
@@ -5,4 +5,4 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in meteor.gemspec
6
6
  gemspec name: 'meteor'
7
7
 
8
- gem 'rubocop', '~> 1.88.1'
8
+ gem 'rubocop', '~> 1.88.2'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meteor (0.9.37)
4
+ meteor (0.9.39)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -18,7 +18,7 @@ GEM
18
18
  racc (1.8.1)
19
19
  rainbow (3.1.1)
20
20
  regexp_parser (2.12.0)
21
- rubocop (1.88.1)
21
+ rubocop (1.88.2)
22
22
  json (~> 2.3)
23
23
  language_server-protocol (~> 3.17.0.2)
24
24
  lint_roller (~> 1.1.0)
@@ -41,9 +41,9 @@ PLATFORMS
41
41
  ruby
42
42
 
43
43
  DEPENDENCIES
44
- bundler (~> 4.0.13)
44
+ bundler (~> 4.0.15)
45
45
  meteor!
46
- rubocop (~> 1.88.1)
46
+ rubocop (~> 1.88.2)
47
47
 
48
48
  BUNDLED WITH
49
- 4.0.13
49
+ 4.0.15
@@ -8,9 +8,9 @@ module Meteor
8
8
  # HTML4 parser (HTMLパーサ)
9
9
  #
10
10
  class ParserImpl < Meteor::Core::Kernel # rubocop:disable Metrics/ClassLength
11
- # KAIGYO_CODE = "\r?\n|\r"
12
- # KAIGYO_CODE = "\r\n|\n|\r"
13
- KAIGYO_CODE = ["\r\n", "\n", "\r"].freeze
11
+ # NEWLINE = "\r?\n|\r"
12
+ # NEWLINE = "\r\n|\n|\r"
13
+ NEWLINE = ["\r\n", "\n", "\r"].freeze
14
14
  BR = '<br>'
15
15
  BR_RE = BR
16
16
 
@@ -172,11 +172,8 @@ module Meteor
172
172
  # analuze document , set newline (ドキュメントをパースし、改行コードをセットする)
173
173
  #
174
174
  def analyze_newline
175
- KAIGYO_CODE.each do |a|
176
- if @root.document.include?(a)
177
- @root.newline = a
178
- # puts "kaigyo:" << @root.newline
179
- end
175
+ NEWLINE.each do |a|
176
+ @root.newline = a if @root.document.include?(a)
180
177
  end
181
178
  end
182
179
 
@@ -8,8 +8,8 @@ module Meteor
8
8
  # XHTML4 parser (XHTML4パーサ)
9
9
  #
10
10
  class ParserImpl < Meteor::Core::Kernel # rubocop:disable Metrics/ClassLength
11
- # KAIGYO_CODE = "\r?\n|\r"
12
- KAIGYO_CODE = ["\r\n", "\n", "\r"].freeze
11
+ # NEWLINE = "\r?\n|\r"
12
+ NEWLINE = ["\r\n", "\n", "\r"].freeze
13
13
  BR = '<br/>'
14
14
  BR_RE = '<br\\/>'
15
15
 
@@ -164,7 +164,7 @@ module Meteor
164
164
  # analyze document , set newline (ドキュメントをパースし、改行コードをセットする)
165
165
  #
166
166
  def analyze_newline
167
- KAIGYO_CODE.each do |a|
167
+ NEWLINE.each do |a|
168
168
  @root.newline = a if @root.document.include?(a)
169
169
  end
170
170
  end
@@ -8,8 +8,8 @@ module Meteor
8
8
  # XML parser (XMLパーサ)
9
9
  #
10
10
  class ParserImpl < Meteor::Core::Kernel
11
- # KAIGYO_CODE = "\r?\n|\r"
12
- KAIGYO_CODE = ["\r\n", "\n", "\r"].freeze
11
+ # NEWLINE = "\r?\n|\r"
12
+ NEWLINE = ["\r\n", "\n", "\r"].freeze
13
13
 
14
14
  TABLE_FOR_ESCAPE_ = {
15
15
  '&' => '&amp;',
@@ -99,11 +99,8 @@ module Meteor
99
99
  # analuze document , set newline (ドキュメントをパースし、改行コードをセットする)
100
100
  #
101
101
  def analyze_newline
102
- KAIGYO_CODE.each do |a|
103
- if @root.document.include?(a)
104
- @root.newline = a
105
- # puts "kaigyo:" << @root.newline
106
- end
102
+ NEWLINE.each do |a|
103
+ @root.newline = a if @root.document.include?(a)
107
104
  end
108
105
  end
109
106
 
@@ -339,18 +339,7 @@ module Meteor
339
339
  #
340
340
  def parser_one(key)
341
341
  @pif = @cache[key.to_s]
342
- case @pif.doc_type
343
- when Meteor::Parser::HTML
344
- Meteor::Ml::Html::ParserImpl.new(@pif)
345
- when Meteor::Parser::XML
346
- Meteor::Ml::Xml::ParserImpl.new(@pif)
347
- when Meteor::Parser::XHTML
348
- Meteor::Ml::Xhtml::ParserImpl.new(@pif)
349
- when Meteor::Parser::HTML4
350
- Meteor::Ml::Html4::ParserImpl.new(@pif)
351
- when Meteor::Parser::XHTML4
352
- Meteor::Ml::Xhtml4::ParserImpl.new(@pif)
353
- end
342
+ new_parser(@pif)
354
343
  end
355
344
 
356
345
  private :parser_one
@@ -364,7 +353,17 @@ module Meteor
364
353
  parser_one(key).root_element
365
354
  end
366
355
 
367
- def new_parser(type)
356
+ def new_parser(val)
357
+ if val.is_a?(Integer) || val.is_a?(Symbol)
358
+ new_parser_type(val)
359
+ elsif val.is_a?(Meteor::Core::Kernel)
360
+ new_parser_ps(val)
361
+ end
362
+ end
363
+
364
+ private :new_parser
365
+
366
+ def new_parser_type(type)
368
367
  case type
369
368
  when Parser::HTML, :html
370
369
  Meteor::Ml::Html::ParserImpl.new
@@ -381,7 +380,24 @@ module Meteor
381
380
  end
382
381
  end
383
382
 
384
- private :new_parser
383
+ private :new_parser_type
384
+
385
+ def new_parser_ps(pif)
386
+ case pif.doc_type
387
+ when Meteor::Parser::HTML
388
+ Meteor::Ml::Html::ParserImpl.new(pif)
389
+ when Meteor::Parser::XML
390
+ Meteor::Ml::Xml::ParserImpl.new(pif)
391
+ when Meteor::Parser::XHTML
392
+ Meteor::Ml::Xhtml::ParserImpl.new(pif)
393
+ when Meteor::Parser::HTML4
394
+ Meteor::Ml::Html4::ParserImpl.new(pif)
395
+ when Meteor::Parser::XHTML4
396
+ Meteor::Ml::Xhtml4::ParserImpl.new(pif)
397
+ end
398
+ end
399
+
400
+ private :new_parser_ps
385
401
 
386
402
  #
387
403
  # set parser (パーサをセットする)
data/lib/meteor.rb CHANGED
@@ -37,11 +37,11 @@ require 'meteor/ml/xml/parser_impl'
37
37
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
38
38
  #
39
39
  # @author Yasumasa Ashida
40
- # @version 0.9.37
40
+ # @version 0.9.39
41
41
  #
42
42
 
43
43
  module Meteor
44
- VERSION = '0.9.37'
44
+ VERSION = '0.9.39'
45
45
 
46
46
  # require 'fileutils'
47
47
 
data/meteor.gemspec CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features|demo)/})
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 4.0.13'
25
+ spec.add_development_dependency 'bundler', '~> 4.0.15'
26
26
  # spec.add_development_dependency "rake"
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meteor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.37
4
+ version: 0.9.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasumasa Ashida
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 4.0.13
18
+ version: 4.0.15
19
19
  type: :development
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 4.0.13
25
+ version: 4.0.15
26
26
  description: A lightweight (X)HTML & XML parser
27
27
  email: ys.ashida@gmail.com
28
28
  executables: []
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 4.0.13
85
+ rubygems_version: 4.0.15
86
86
  specification_version: 4
87
87
  summary: A lightweight (X)HTML & XML parser
88
88
  test_files: