meteor 0.9.41 → 0.9.42

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: 46eb97e00adae645d7675426b601a1f1d90ef372aad0c4106d169b86bbb72b46
4
- data.tar.gz: efa01e2a273c17a070986389581b032cbfc1cd64e47164cf247f675fcdde5554
3
+ metadata.gz: 06e3af4f688641740f8ca20eccb680649355e66a6d370c5a9f09dc63ef2a5fea
4
+ data.tar.gz: d9a404cf2d03bc439a6b88f7aa60d39add1a7d49ed57fa46a9348339fefa75d4
5
5
  SHA512:
6
- metadata.gz: d7d915e4808fe38ce59fb1d127b534cb18a2c1c627742031185bb20f6ba32aeb67dec856dfdb042854ce9a0b6775111191ea2c031463a2cf8c7f75f2cf6a3de9
7
- data.tar.gz: 9a030a41653d7c0c69ad35c37355ef8acfdd406f7679e36c7fcf7d039326c21b32e86ed9ed173b588d37c430e776c9647c0aff253361ce97344f17b128da65bd
6
+ metadata.gz: cce916500df8f9e7e3648d7144d3a9b68e0c4df21cd8ca70a0f5b667b8746897d5daca0fe8f741b757ec6ec052e4d768ef0646beb9d2990e9936370c646766b7
7
+ data.tar.gz: 6d2d1e9f403946998c2ec58123853021e8fc30adcd6602f425cbfb4a6f221c49c5ad6f55b014b9d4ccf2ce0eebf41e6670fb69721497a852605f12ed530347f0
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.9.42 / 2026-07-21 Yasumasa Ashida <ys.ashida@gmail.com>
2
+
3
+ * Refactor Meteor::Element
4
+
1
5
  == 0.9.41 / 2026-07-14 Yasumasa Ashida <ys.ashida@gmail.com>
2
6
 
3
7
  * Remove unnecessary comments
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meteor (0.9.41)
4
+ meteor (0.9.42)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -45,8 +45,6 @@ module Meteor
45
45
  RE_FIND_FOUR = Regexp.new(PATTERN_FIND_FOUR)
46
46
  RE_FIND_FIVE = Regexp.new(PATTERN_FIND_FIVE)
47
47
 
48
- RE_CHILDLESS = Regexp.new('\\A[^<>]*\\Z')
49
-
50
48
  RE_GET_ATTRS_MAP = Regexp.new('([^\\s]*)="([^\"]*)"')
51
49
 
52
50
  RE_CLEAN_ONE = Regexp.new('<!--\\s@[^<>]*\\s[^<>]*(\\s)*-->')
@@ -1947,12 +1945,9 @@ module Meteor
1947
1945
  # @param [Meteor::Element] elm element (要素)
1948
1946
  # @return [Meteor::Element] element (要素)
1949
1947
  #
1950
- def shadow(elm) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
1948
+ def shadow(elm) # rubocop:disable Metrics/AbcSize
1951
1949
  return unless elm.normal
1952
1950
 
1953
- # case of normal element (内容あり要素の場合)
1954
- self.childless = elm
1955
-
1956
1951
  pif2 = self.class.new(self)
1957
1952
 
1958
1953
  @elm_ = elm.clone(pif2)
@@ -1970,14 +1965,6 @@ module Meteor
1970
1965
 
1971
1966
  # private :shadow
1972
1967
 
1973
- def childless=(elm)
1974
- @res = RE_CHILDLESS.match(elm.mixed_content)
1975
-
1976
- elm.childless = true if @res
1977
- end
1978
-
1979
- private :childless=
1980
-
1981
1968
  def match?(regex, str)
1982
1969
  case regex
1983
1970
  when Regexp
@@ -21,8 +21,6 @@ module Meteor
21
21
  # @return [true,false] content normal flag (内容存在フラグ)
22
22
  # @!attribute [rw] cx
23
23
  # @return [true,false] comment extension tag flag (コメント拡張タグフラグ)
24
- # @!attribute [rw] childless
25
- # @return [true,false] child childless flag (子要素なしフラグ)
26
24
  # @!attribute [rw] parser
27
25
  # @return [Meteor::Parser] parser(パーサ)
28
26
  # @!attribute [rw] type_value
@@ -37,7 +35,7 @@ module Meteor
37
35
  # @return [true,false] deletion flag (削除フラグ)
38
36
  #
39
37
  class Element # rubocop:disable Metrics/ClassLength
40
- attr_accessor :name, :attributes, :mixed_content, :raw_content, :pattern, :document_sync, :normal, :cx, :childless,
38
+ attr_accessor :name, :attributes, :mixed_content, :raw_content, :pattern, :document_sync, :normal, :cx,
41
39
  :parser, :type_value, :usable, :origin, :copy, :removed
42
40
 
43
41
  alias tag name
@@ -46,8 +44,7 @@ module Meteor
46
44
  alias empty normal
47
45
  alias empty= normal=
48
46
 
49
- alias mono childless
50
- alias mono= childless=
47
+ RE_CHILDLESS = Regexp.new('\\A[^<>]*\\Z')
51
48
 
52
49
  #
53
50
  # initializer (イニシャライザ)
@@ -90,7 +87,6 @@ module Meteor
90
87
  # @parser=nil
91
88
  # @normal = false
92
89
  # @cx = false
93
- # @childless = false
94
90
  # @parent = false
95
91
  @usable = true
96
92
  end
@@ -108,7 +104,7 @@ module Meteor
108
104
 
109
105
  private :initialize_e
110
106
 
111
- def initialize_two(elm, ps) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Naming/MethodParameterName
107
+ def initialize_two(elm, ps) # rubocop:disable Metrics/MethodLength,Naming/MethodParameterName
112
108
  @parser = ps
113
109
  if normal
114
110
  ps.element(elm)
@@ -121,7 +117,6 @@ module Meteor
121
117
  @document = String.new(elm.document)
122
118
  @normal = elm.normal
123
119
  @cx = elm.cx
124
- @childless = elm.childless
125
120
  @origin = elm
126
121
  # @usable = false
127
122
  elm.copy = self
@@ -189,6 +184,25 @@ module Meteor
189
184
 
190
185
  private :clone_one
191
186
 
187
+ #
188
+ # get childless flag (子要素なしフラグを取得する)
189
+ # @return [true,false] childless flag (子要素なしフラグ)
190
+ #
191
+ def childless
192
+ if @childless.nil?
193
+ @res = RE_CHILDLESS.match(mixed_content)
194
+
195
+ @childless = if @res
196
+ true
197
+ else
198
+ false
199
+ end
200
+ end
201
+ @childless
202
+ end
203
+
204
+ alias mono childless
205
+
192
206
  #
193
207
  # set document (ドキュメントをセットする)
194
208
  # @param [String] doc document (ドキュメント)
@@ -77,7 +77,7 @@ module Meteor
77
77
  end
78
78
 
79
79
  #
80
- # Elements Class (要素ファクトリ クラス)
80
+ # Elements Factory Class (要素ファクトリ クラス)
81
81
  #
82
82
  ElementFactory = Elements
83
83
  end
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.41
40
+ # @version 0.9.42
41
41
  #
42
42
 
43
43
  module Meteor
44
- VERSION = '0.9.41'
44
+ VERSION = '0.9.42'
45
45
 
46
46
  # require 'fileutils'
47
47
 
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.41
4
+ version: 0.9.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasumasa Ashida