meteor 0.9.25 → 0.9.26

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: 972f9396e2d45e6310cbfa0fda64ae798d10e150b7241db77cc07c954aa0a8ce
4
- data.tar.gz: 07e9dc8c2e6f4018c3c00c6ed0d68fc2c2393c1daf43977e87fc50d9d063f40e
3
+ metadata.gz: a6776307290552674dcb55922ddc18ed004c4b79c1176c80ddd9f60ad87b0b1d
4
+ data.tar.gz: ec1e5797f5e09c537603b7ac67866cd51ab0cbbd80f6dd30074d9e43642b0fb4
5
5
  SHA512:
6
- metadata.gz: e90da0e028c4cd8c41a81012fa74121c6f68d7ace825b540eea77ae9b7b8e857b99341c5eeba3c1ac0991bff7b743dad90fb406d9d95baa147c94f92cd33b214
7
- data.tar.gz: d55c86399dcdaaf6bc11fec20bf25d4ef033e5e731014cb57e80f40b647b25d0ce6dcca84e8f1ac7c222c12142cc09362bd0782cc917c219e04a97ac0cb0df3a
6
+ metadata.gz: f9b7bdd39d61dc47cf3929eda3a4b9a08399d3b72223b6ac9a392ebce76566b11872bb6a186e73f793fa58e2b897ead3fd2e4aeb3cac08c8a08f3eae5731c9d6
7
+ data.tar.gz: 940e99265e10e13149cc4fc0bd50732d8ee9b1f3c7a66dfcc2ecf012fc8e7602b016041ae6453b444085dfcdfe97be6fb6f7fc4818050015c06df5872925c5f0
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.9.26 / 2026-06-30 Yasumasa Ashida <ys.ashida@gmail.com>
2
+
3
+ * Refactoring
4
+
1
5
  == 0.9.25 / 2026-06-25 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.25)
4
+ meteor (0.9.26)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -111,18 +111,22 @@ module Meteor
111
111
  # set character encoding (文字エンコーディングをセットする)
112
112
  # @param [String] enc character encoding (文字エンコーディング)
113
113
  #
114
- def character_encoding=(enc)
115
- @root.character_encoding = enc
114
+ def enc=(enc)
115
+ @root.enc = enc
116
116
  end
117
117
 
118
+ alias_method :character_encoding=, :enc=
119
+
118
120
  #
119
121
  # get character encoding (文字エンコーディングを取得する)
120
122
  # @return [String] character encoding (文字エンコーディング)
121
123
  #
122
- def character_encoding
123
- @root.character_encoding
124
+ def enc
125
+ @root.enc
124
126
  end
125
127
 
128
+ alias_method :character_encoding, :enc
129
+
126
130
  #
127
131
  # get root element (ルート要素を取得する)
128
132
  # @return [Meteor::RootElement] root element (ルート要素)
@@ -158,23 +162,25 @@ module Meteor
158
162
  #
159
163
  def read(file_path, enc)
160
164
  # try {
161
- @character_encoding = enc
162
- # open file (ファイルのオープン)
163
- if "UTF-8".eql?(enc)
164
- # io = File.open(file_path,"r:" << enc)
165
- io = File.open(file_path, "r:UTF-8")
165
+ self.enc = enc
166
+ mode = if enc == "UTF-8"
167
+ # String.new("") << "r:" << enc
168
+ "r:UTF-8"
166
169
  else
167
- io = File.open(file_path, String.new("") << "r:" << enc << ":utf-8")
170
+ String.new("") << "r:" << enc << ":utf-8"
168
171
  end
169
172
 
173
+ # open file (ファイルのオープン)
174
+ io = File.open(file_path, mode)
175
+
170
176
  # load and save (読込及び格納)
171
177
  @root.document = io.read
172
178
 
173
- parse
174
-
175
179
  # close file (ファイルのクローズ)
176
180
  io.close
177
181
 
182
+ parse
183
+
178
184
  return @root.document
179
185
  end
180
186
 
@@ -2148,7 +2154,6 @@ module Meteor
2148
2154
  # private :shadow
2149
2155
 
2150
2156
  def set_mono_info(elm)
2151
-
2152
2157
  @res = @@pattern_set_mono1.match(elm.mixed_content)
2153
2158
 
2154
2159
  if @res
@@ -2164,7 +2169,7 @@ module Meteor
2164
2169
  elsif regex.kind_of?(Array)
2165
2170
  is_match_a(regex, str)
2166
2171
  elsif regex.kind_of?(String)
2167
- if regex.eql?(str.downcase)
2172
+ if regex == str.downcase
2168
2173
  true
2169
2174
  else
2170
2175
  false
@@ -2189,9 +2194,7 @@ module Meteor
2189
2194
  def is_match_a(regex, str)
2190
2195
  str = str.downcase
2191
2196
  regex.each do |item|
2192
- if item.eql?(str)
2193
- return true
2194
- end
2197
+ return true if item == str
2195
2198
  end
2196
2199
 
2197
2200
  false
@@ -112,11 +112,20 @@ module Meteor
112
112
  # @param [Meteor::Element] elm element (要素)
113
113
  #
114
114
  def initialize_e(elm)
115
+ initialize_2(elm, elm.parser)
116
+ @usable = true
117
+ end
118
+
119
+ private :initialize_e
120
+
121
+ def initialize_2(elm, ps)
122
+ @parser = ps
115
123
  if self.normal
116
- self.parser.element(elm)
124
+ ps.element(elm)
117
125
  else
118
126
  @name = elm.name
119
127
  @attributes = String.new(elm.attributes)
128
+ @mixed_content = String.new(elm.mixed_content)
120
129
  # @pattern = String.new(elm.pattern)
121
130
  @pattern = elm.pattern
122
131
  @document = String.new(elm.document)
@@ -124,29 +133,11 @@ module Meteor
124
133
  @cx = elm.cx
125
134
  @mono = elm.mono
126
135
  @origin = elm
127
- @parser = elm.parser
128
- @usable = true
136
+ # @usable = false
137
+ elm.copy = self
129
138
  end
130
139
  end
131
140
 
132
- private :initialize_e
133
-
134
- def initialize_2(elm, ps)
135
- @name = elm.name
136
- @attributes = String.new(elm.attributes)
137
- @mixed_content = String.new(elm.mixed_content)
138
- # @pattern = String.new(elm.pattern)
139
- @pattern = elm.pattern
140
- @document = String.new(elm.document)
141
- @normal = elm.normal
142
- @cx = elm.cx
143
- @mono = elm.mono
144
- @parser = ps
145
- # @usable = false
146
- @origin = elm
147
- elm.copy = self
148
- end
149
-
150
141
  private :initialize_2
151
142
 
152
143
  #
@@ -493,7 +493,7 @@ module Meteor
493
493
  @res = match_p.match(elm.attributes)
494
494
 
495
495
  if !@res
496
- if !"".eql?(elm.attributes) && !"".eql?(elm.attributes.strip)
496
+ if elm.attributes != "" && elm.attributes.strip != ""
497
497
  elm.attributes = String.new("") << " " << elm.attributes.strip
498
498
  else
499
499
  elm.attributes = String.new("")
@@ -190,7 +190,7 @@ module Meteor
190
190
  if paths.length == 1
191
191
  return File.basename(paths[0], ".*")
192
192
  else
193
- if ".".eql?(paths[0])
193
+ if paths[0] == "."
194
194
  paths.delete_at(0)
195
195
  paths[paths.length - 1] = File.basename(paths[paths.length - 1], ".*")
196
196
  return String.new("") << "/" << paths.join("/")
@@ -11,14 +11,17 @@ module Meteor
11
11
  # @return [String] newline (改行コード)
12
12
  # @!attribute [rw] charset
13
13
  # @return [String] charset (文字コード)
14
- # @!attribute [rw] character_encoding
14
+ # @!attribute [rw] enc
15
15
  # @return [String] character encoding (文字エンコーディング)
16
16
  #
17
17
  class RootElement < Element
18
18
  attr_accessor :content_type
19
19
  attr_accessor :kaigyo_code
20
20
  attr_accessor :charset
21
- attr_accessor :character_encoding
21
+ attr_accessor :enc
22
22
  # attr_accessor :document #[String] document (ドキュメント)
23
+
24
+ alias_method :character_encoding, :enc
25
+ alias_method :character_encoding=, :enc=
23
26
  end
24
27
  end
data/lib/meteor.rb CHANGED
@@ -36,11 +36,11 @@ require "meteor/ml/xml/parser_impl"
36
36
  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37
37
  #
38
38
  # @author Yasumasa Ashida
39
- # @version 0.9.25
39
+ # @version 0.9.26
40
40
  #
41
41
 
42
42
  module Meteor
43
- VERSION = "0.9.25"
43
+ VERSION = "0.9.26"
44
44
 
45
45
  # require 'fileutils'
46
46
 
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.25
4
+ version: 0.9.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasumasa Ashida