meteor 0.9.17 → 0.9.18

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: 5a115fb12155d38898790a30ed917abe7e22fdac5ce8d4bc76e732e0eb2c4b64
4
- data.tar.gz: f673cc5f72f4a3c9c8253d8fee3cb44365894911f9ad4863eb29693d10fe36b2
3
+ metadata.gz: ea632b32536a814320a44110909a51a869dc09a9546d55307c8ca6e22e1e12ec
4
+ data.tar.gz: 2e5be17d0c3654208400db5731f389cb67fe9b616c1004965f820757c8d9a03b
5
5
  SHA512:
6
- metadata.gz: 2fe5a34dc71d3f5f889300653179b98d9c81b87652c1658e95c091b89079f97eeb4e1e8489a4cc037eda6dc935dc6f4d0a8fa56e2b0c04cb26e3dd6780bfda0c
7
- data.tar.gz: 2b578499df7e05f249f493ee6646f026655f3eeb6b819e01b0822a8f83256cc6d39410907f0ecb28f62f0a4dedca2bcf9da6b46b9b121cdf496d2232cc4aac70
6
+ metadata.gz: 573c2429e3de96abd5551c92cbd14ebf15ebf5b87a9edf86559c3905d1701dc9a094ab86c2a72af52ab1ff17f367c57832560df2a53e9a4a5e15166113cebe13
7
+ data.tar.gz: 32874256cd55783e984614448088ecc8abd05fbc638cd718ca2e9a8114a453dec708f3f03dfd915f4157142a266f76ab88ff9a0f9c4bf37b8c2da021e8065965
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 0.9.18 / 2026-06-20 Yasumasa Ashida <ys.ashida@gmail.com>
2
+
3
+ * Fixnum → Integer
4
+ * Refactoring
5
+
1
6
  == 0.9.17 / 2026-06-19 Yasumasa Ashida <ys.ashida@gmail.com>
2
7
 
3
8
  * Refactoring
data/demo/html.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  # require 'rubygems'
6
6
  require "meteor"
7
7
 
8
- Meteor::Elements.add(:html, "ml/sample_html.html", "UTF-8")
8
+ Meteor::Elements.add(:html, "ml/sample_html.html")
9
9
  root = Meteor::Elements.get("/ml/sample_html")
10
10
 
11
11
  start_time = Time.new.to_f
@@ -13,7 +13,7 @@ start_time = Time.new.to_f
13
13
  elm_hello = root.element(id: "hello")
14
14
  # elm_hello.attr(class: 'red')
15
15
  elm_hello["class"] = "red"
16
- # elm_hello['class'] = nil # elm_hello.remove_attr('class')
16
+ # elm_hello['class'] = nil # elm_hello.remove_attr('class')
17
17
 
18
18
  elm_hello2 = root.element(id: "hello2")
19
19
  # elm_hello2.content('Hello,Tester')
data/demo/html4.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  require "meteor"
7
7
 
8
8
  # Meteor::Elements.add(:html4,'ml/sample_4.html', 'UTF-8')
9
- Meteor::Elements.options = {type: :html4}
9
+ Meteor::Elements.options = { type: :html4 }
10
10
  Meteor::Elements.add("ml/sample_html4.html")
11
11
 
12
12
  root = Meteor::Elements.get("/ml/sample_html4")
@@ -31,12 +31,12 @@ elm_hello2.content = "Hello,Tester"
31
31
  # puts elm_hello3.mixed_content
32
32
 
33
33
  elm_text1 = root.element("input", id: "text1")
34
- # elm_text1['value'] = 'めも' # elm_text1.attr(value: 'めも')
35
- # elm_text1.attr = {value: 'メモ'}
36
- # elm_text1['disabled'] = true # elm_text1.attr(disabled: true)
37
- elm_text1.attrs = {value: "メモ", disabled: true, readonly: true}
34
+ # elm_text1['value'] = 'めも' # elm_text1.attr(value: 'めも')
35
+ # elm_text1.attr = { value: 'メモ' }
36
+ # elm_text1['disabled'] = true. # elm_text1.attr(disabled: true)
37
+ elm_text1.attrs = { value: "メモ", disabled: true, readonly: true }
38
38
  # puts elm_text1.attrs
39
- # elm_text1['disabled'] = nil # elm_text1.remove_attr('disabled')
39
+ # elm_text1['disabled'] = nil # elm_text1.remove_attr('disabled')
40
40
  # map = elm_text1.attr_map
41
41
  # map.names.each { |item|
42
42
  # puts item
@@ -46,9 +46,9 @@ elm_text1.attrs = {value: "メモ", disabled: true, readonly: true}
46
46
  # elm_radio1 = root.element('input', id: 'radio1', type: 'radio')
47
47
  ## elm_radio1 = root.css('input[id=radio1][type=radio]')
48
48
  ## elm_radio1 = root.css('# radio1') # elm_radio1 = root.css('input# radio1')
49
- ## elm_radio1 = root.css('.test') # elm_radio1 = root.css('input.test')
49
+ ## elm_radio1 = root.css('.test') # elm_radio1 = root.css('input.test')
50
50
  ## elm_radio1 = root.css('[id=radio1][type=radio]')
51
- # elm_radio1['checked'] = true # elm_radio1.attr(checked: true)
51
+ # elm_radio1['checked'] = true # elm_radio1.attr(checked: true)
52
52
  # puts elm_radio1.document
53
53
 
54
54
  # elm_select1 = root.element('select', id: 'select1')
data/demo/xhtml.rb CHANGED
@@ -5,7 +5,7 @@
5
5
  # require 'rubygems'
6
6
  require "meteor"
7
7
 
8
- Meteor::Elements.add(:xhtml, "ml/sample_xhtml.html", "UTF-8")
8
+ Meteor::Elements.add(:xhtml, "ml/sample_xhtml.html")
9
9
  root = Meteor::Elements.get("/ml/sample_xhtml")
10
10
 
11
11
  startTime = Time.new.to_f
@@ -13,7 +13,7 @@ startTime = Time.new.to_f
13
13
  elm_hello = root.element(id: "hello")
14
14
  # elm_hello.attr(class: "red")
15
15
  elm_hello["class"] = "red"
16
- # elm_hello['class'] = nil # elm_hello.remove_attr('class')
16
+ # elm_hello['class'] = nil # elm_hello.remove_attr('class')
17
17
  # elm_hello.attr(class: nil)
18
18
 
19
19
  elm_hello2 = root.element(id: "hello2")
@@ -40,7 +40,7 @@ elm_text1["required"] = true
40
40
  # }
41
41
 
42
42
  # elm_radio1 = root.element("input",id: "radio1", type: "radio")
43
- # elm_radio1['checked'] = true # elm_radio1.attr(checked: true)
43
+ # elm_radio1['checked'] = true # elm_radio1.attr(checked: true)
44
44
 
45
45
  # elm_select1 = root.element("select",id: "select1")
46
46
  # elm_select1 = root.element("select")
data/demo/xhtml4.rb CHANGED
@@ -13,7 +13,7 @@ startTime = Time.new.to_f
13
13
  elm_hello = root.element("id", "hello")
14
14
  # elm_hello.attr(class: "red")
15
15
  elm_hello["class"] = "red"
16
- # elm_hello['class'] = nil # elm_hello.remove_attr('class')
16
+ # elm_hello['class'] = nil # elm_hello.remove_attr('class')
17
17
 
18
18
  elm_hello2 = root.element(id: "hello2")
19
19
  # elm_hello2.content("Hello,Tester")
data/demo/xml.rb CHANGED
@@ -90,8 +90,8 @@ elm_ = root.element(elm7)
90
90
  # co_elm.content = i # co_elm.content(i)
91
91
  # co_elm.flash
92
92
  # }
93
-
94
- # elm3['id3'] = 'dd' # elm3.attr(id3: 'dd')
93
+ #
94
+ # elm3['id3'] = 'dd' # elm3.attr(id3: 'dd')
95
95
 
96
96
  root.flash
97
97
 
@@ -8,7 +8,7 @@ module Meteor
8
8
  # @!attribute [rw] element_cache
9
9
  # @return [Hash] element cache (要素キャッシュ)
10
10
  # @!attribute [rw] doc_type
11
- # @return [Fixnum] document type (ドキュメントタイプ)
11
+ # @return [Integer] document type (ドキュメントタイプ)
12
12
  # @!attribute [rw] document_hook
13
13
  # @return [String] hook document (フック・ドキュメント)
14
14
  # @!attribute [rw] element_hook
@@ -124,7 +124,6 @@ module Meteor
124
124
  # @param [String] enc character encoding of input file (入力ファイルの文字コード)
125
125
  #
126
126
  def read(file_path, enc)
127
-
128
127
  # try {
129
128
  @character_encoding = enc
130
129
  # open file (ファイルのオープン)
@@ -253,13 +252,11 @@ module Meteor
253
252
  if @elm_
254
253
  @element_cache.store(@elm_.object_id, @elm_)
255
254
  end
256
-
257
255
  when TWO
258
256
  element_4(elm.to_s, attrs.to_s, args[0].to_s, args[1])
259
257
  if @elm_
260
258
  @element_cache.store(@elm_.object_id, @elm_)
261
259
  end
262
-
263
260
  when THREE
264
261
  element_5(elm.to_s, attrs.to_s, args[0], args[1].to_s, args[2])
265
262
  if @elm_
@@ -578,8 +575,8 @@ module Meteor
578
575
  # document (全体)
579
576
  @elm_.document = @res[0]
580
577
  # pattern (空要素検索用パターン)
581
- @pattern_cc = String.new("") << "<" << @_name << "(\\s[^<>]*" << @_attr_name << "=\"" << @_attr_value << closer
582
- # @pattern_cc = "<#{@_name}\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}#{closer}"
578
+ # @pattern_cc = String.new("") << "<" << @_name << "(\\s[^<>]*" << @_attr_name << "=\"" << @_attr_value << closer
579
+ @pattern_cc = "<#{@_name}(\\s[^<>]*#{@_attr_name}=\"#{@_attr_value}#{closer}"
583
580
  @elm_.pattern = @pattern_cc
584
581
  @elm_.parser = self
585
582
 
@@ -825,7 +822,6 @@ module Meteor
825
822
  # @return [Meteor::Element] element (要素)
826
823
  #
827
824
  def element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
828
-
829
825
  quote_element_5(name, attr_name1, attr_value1, attr_name2, attr_value2)
830
826
 
831
827
  @pattern_cc_1 = "<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)\\/>|<#{@_name}(\\s[^<>]*(?:#{@_attr_name1}=\"#{@_attr_value1}\"[^<>]*#{@_attr_name2}=\"#{@_attr_value2}\"|#{@_attr_name2}=\"#{@_attr_value2}\"[^<>]*#{@_attr_name1}=\"#{@_attr_value1}\")[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
@@ -959,7 +955,6 @@ module Meteor
959
955
  private :element_with_5_1
960
956
 
961
957
  def element_with_5_2
962
-
963
958
  element_pattern_with_5_2
964
959
 
965
960
  if @sbuf.length == ZERO || @cnt != ZERO
@@ -1088,7 +1083,6 @@ module Meteor
1088
1083
  private :quote_element_4
1089
1084
 
1090
1085
  def element_pattern_4
1091
-
1092
1086
  # @pattern_cc = String.new('') << '<([^<>"]*)\\s([^<>]*(' << @_attr_name1 << '="'
1093
1087
  # @pattern_cc << @_attr_value1 << '"[^<>]*' << @_attr_name2 << '="'
1094
1088
  # @pattern_cc << @_attr_value2 << '"|' << @_attr_name2 << '="'
@@ -1458,7 +1452,6 @@ module Meteor
1458
1452
  nil
1459
1453
  end
1460
1454
  end
1461
-
1462
1455
  when 2
1463
1456
  if selector[0] == "["
1464
1457
  if @res = @@pattern_find_4.match(selector)
@@ -1509,7 +1502,6 @@ module Meteor
1509
1502
  remove_attr(elm, attr.to_s)
1510
1503
  end
1511
1504
  end
1512
-
1513
1505
  elsif attr.kind_of?(Hash) && attr.size == 1
1514
1506
  if attr.values[0] != nil
1515
1507
  elm.document_sync = true
@@ -1547,7 +1539,6 @@ module Meteor
1547
1539
  private :set_attribute_3
1548
1540
 
1549
1541
  def edit_attrs_(elm, attr_name, attr_value)
1550
-
1551
1542
  # attribute search (属性検索)
1552
1543
  # @res = @pattern.match(elm.attributes)
1553
1544
 
@@ -1591,7 +1582,6 @@ module Meteor
1591
1582
  private :get_attr_value
1592
1583
 
1593
1584
  def get_attr_value_(elm, attr_name)
1594
-
1595
1585
  # attribute search pattern (属性検索用パターン)
1596
1586
  @pattern = Meteor::Core::Util::PatternCache.get(String.new("") << attr_name << "=\"([^\"]*)\"")
1597
1587
  # @pattern = Meteor::Core::Util::PatternCache.get("#{attr_name}=\"([^\"]*)\"")
@@ -1888,7 +1878,6 @@ module Meteor
1888
1878
  if @elm_
1889
1879
  @element_cache.store(@elm_.object_id, @elm_)
1890
1880
  end
1891
-
1892
1881
  when TWO
1893
1882
  cxtag_2(args[0].to_s, args[1].to_s)
1894
1883
  if @elm_
@@ -1951,7 +1940,6 @@ module Meteor
1951
1940
  # @return [Meteor::Element] element (要素)
1952
1941
  #
1953
1942
  def cxtag_1(id)
1954
-
1955
1943
  @_id = Regexp.quote(id)
1956
1944
 
1957
1945
  @pattern_cc = String.new("") << "<!--\\s@([^<>]*)\\s[^<>]*id=\"" << @_id << "\""
@@ -2020,7 +2008,6 @@ module Meteor
2020
2008
  private :edit_document_1
2021
2009
 
2022
2010
  def edit_document_2(elm, closer)
2023
-
2024
2011
  # replace tag (タグ置換)
2025
2012
  @pattern = Meteor::Core::Util::PatternCache.get(elm.pattern)
2026
2013
  @root.document.sub!(@pattern, elm.document)
@@ -2032,7 +2019,6 @@ module Meteor
2032
2019
  # reflect (反映する)
2033
2020
  #
2034
2021
  def flash
2035
-
2036
2022
  if self.element_hook
2037
2023
  if self.element_hook.origin.mono
2038
2024
  if self.element_hook.origin.cx
@@ -23,7 +23,7 @@ module Meteor
23
23
  # @return [Regexp] pattern (パターン)
24
24
  # @overload get(regex,option)
25
25
  # @param [String] regex regular expression (正規表現)
26
- # @param [Fixnum] option option of Regex (オプション)
26
+ # @param [Integer] option option of Regex (オプション)
27
27
  # @return [Regexp] pattern (パターン)
28
28
  #
29
29
  def self.get(*args)
@@ -78,7 +78,7 @@ module Meteor
78
78
  ##
79
79
  ## パターンを取得する
80
80
  ## @param [String] regex 正規表現
81
- ## @param [Fixnum] option オプション
81
+ ## @param [Integer] option オプション
82
82
  ## @return [Regexp] パターン
83
83
  ##
84
84
  # def self.get_2(regex, option)
@@ -76,7 +76,6 @@ module Meteor
76
76
  else
77
77
  raise ArgumentError
78
78
  end
79
-
80
79
  when Meteor::TWO
81
80
  @name = args[0].name
82
81
  @attributes = String.new(args[0].attributes)
@@ -214,7 +213,6 @@ module Meteor
214
213
  # @document = "<#{@name}#{@attributes}>"
215
214
  end
216
215
  end
217
-
218
216
  when Parser::XHTML, Parser::XHTML4, Parser::XML
219
217
  if @cx
220
218
  # @pattern_cc = String.new('') << '<!-- @' << elm.name << ' ' << elm.attributes << '-->' << elm.mixed_content << '<!-- /@' << elm.name << ' -->'
@@ -25,13 +25,13 @@ module Meteor
25
25
  #
26
26
  #@overload add(type,relative_path,enc)
27
27
  # generate parser (パーサを作成する)
28
- # @param [Fixnum] type type of parser (パーサ・タイプ)
28
+ # @param [Integer] type type of parser (パーサ・タイプ)
29
29
  # @param [String] relative_path relative file path (相対ファイルパス)
30
30
  # @param [String] enc character encoding (エンコーディング)
31
31
  # @return [Meteor::Parser] parser (パーサ)
32
32
  #@overload add(type,relative_path)
33
33
  # generate parser (パーサを作成する)
34
- # @param [Fixnum] type type of parser (パーサ・タイプ)
34
+ # @param [Integer] type type of parser (パーサ・タイプ)
35
35
  # @param [String] relative_path relative file path (相対ファイルパス)
36
36
  # @return [Meteor::Parser] parser (パーサ)
37
37
  #
@@ -42,7 +42,7 @@ module Meteor
42
42
  #
43
43
  # @overload add_str(type, relative_url, doc)
44
44
  # generate parser (パーサを作成する)
45
- # @param [Fixnum] type type of parser (パーサ・タイプ)
45
+ # @param [Integer] type type of parser (パーサ・タイプ)
46
46
  # @param [String] relative_url relative URL (相対URL)
47
47
  # @param [String] doc document (ドキュメント)
48
48
  # @return [Meteor::Parser] parser (パーサ)
@@ -148,13 +148,13 @@ module Meteor
148
148
  # @return [Meteor::Parser] parser (パーサ)
149
149
  #@overload add(type,relative_path,enc)
150
150
  # generate parser (パーサを作成する)
151
- # @param [Fixnum,Symbol] type type of parser (パーサ・タイプ)
151
+ # @param [Integer,Symbol] type type of parser (パーサ・タイプ)
152
152
  # @param [String] relative_path relative file path (相対ファイルパス)
153
153
  # @param [String] enc character encoding (文字エンコーディング)
154
154
  # @return [Meteor::Parser] parser (パーサ)
155
155
  #@overload add(type,relative_path)
156
156
  # generate parser (パーサを作成する)
157
- # @param [Fixnum,Symbol] type type of parser (パーサ・タイプ)
157
+ # @param [Integer,Symbol] type type of parser (パーサ・タイプ)
158
158
  # @param [String] relative_path relative file path (相対ファイルパス)
159
159
  # @return [Meteor::Parser] parser (パーサ)
160
160
  #
@@ -163,7 +163,7 @@ module Meteor
163
163
  when 1
164
164
  add_1(args[0])
165
165
  when 2
166
- if args[0].kind_of?(Fixnum) || args[0].kind_of?(Symbol)
166
+ if args[0].kind_of?(Integer) || args[0].kind_of?(Symbol)
167
167
  add_2_n(args[0], args[1])
168
168
  elsif args[0].kind_of?(String)
169
169
  add_2_s(args[0], args[1])
@@ -205,7 +205,7 @@ module Meteor
205
205
 
206
206
  #
207
207
  # generate parser (パーサを作成する)
208
- # @param [Fixnum,Symbol] type type of parser (パーサ・タイプ)
208
+ # @param [Integer,Symbol] type type of parser (パーサ・タイプ)
209
209
  # @param [String] relative_path relative file path (相対ファイルパス)
210
210
  # @param [String] enc character encoding (文字エンコーディング)
211
211
  # @return [Meteor::Parser] parser(パーサ)
@@ -222,7 +222,7 @@ module Meteor
222
222
 
223
223
  #
224
224
  # generate parser (パーサを作成する)
225
- # @param [Fixnum,Symbol] type type of parser(パーサ・タイプ)
225
+ # @param [Integer,Symbol] type type of parser(パーサ・タイプ)
226
226
  # @param [String] relative_path relative file path (相対ファイルパス)
227
227
  # @return [Meteor::Parser] parser (パーサ)
228
228
  #
@@ -262,14 +262,14 @@ module Meteor
262
262
  # @return [Meteor::Parser] parser (パーサ)
263
263
  #@overload parser(type,relative_path,enc)
264
264
  # generate parser (パーサを作成する)
265
- # @param [Fixnum] type type of parser (パーサ・タイプ)
265
+ # @param [Integer] type type of parser (パーサ・タイプ)
266
266
  # @param [String] relative_path relative file path (相対ファイルパス)
267
267
  # @param [String] enc character encoding (エンコーディング)
268
268
  # @return [Meteor::Parser] parser (パーサ)
269
269
  # @deprecated
270
270
  #@overload parser(type,relative_path)
271
271
  # generate parser (パーサを作成する)
272
- # @param [Fixnum] type type of parser (パーサ・タイプ)
272
+ # @param [Integer] type type of parser (パーサ・タイプ)
273
273
  # @param [String] relative_path relative file path (相対ファイルパス)
274
274
  # @return [Meteor::Parser] parser (パーサ)
275
275
  # @deprecated
@@ -318,7 +318,7 @@ module Meteor
318
318
  #
319
319
  # @overload add_str(type, relative_url, doc)
320
320
  # generate parser (パーサを作成する)
321
- # @param [Fixnum] type type of parser (パーサ・タイプ)
321
+ # @param [Integer] type type of parser (パーサ・タイプ)
322
322
  # @param [String] relative_url relative URL (相対URL)
323
323
  # @param [String] doc document (ドキュメント)
324
324
  # @return [Meteor::Parser] parser (パーサ)
@@ -341,7 +341,7 @@ module Meteor
341
341
 
342
342
  #
343
343
  # generate parser (パーサを作成する)
344
- # @param [Fixnum,Symbol] type type of parser (パーサ・タイプ)
344
+ # @param [Integer,Symbol] type type of parser (パーサ・タイプ)
345
345
  # @param [String] relative_url relative URL (相対URL)
346
346
  # @param [String] doc document (ドキュメント)
347
347
  # @return [Meteor::Parser] parser (パーサ)
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.17
39
+ # @version 0.9.18
40
40
  #
41
41
 
42
42
  module Meteor
43
- VERSION = "0.9.17"
43
+ VERSION = "0.9.18"
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.17
4
+ version: 0.9.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasumasa Ashida