meteor 0.9.23 → 0.9.24
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 +4 -4
- data/ChangeLog +6 -0
- data/Gemfile.lock +1 -1
- data/demo/html.rb +3 -0
- data/lib/meteor/core/kernel.rb +1 -1
- data/lib/meteor/element.rb +18 -7
- data/lib/meteor/ml/html4/parser_impl.rb +2 -1
- data/lib/meteor.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80d59c6205221bcf3bcc849a8c70a7689eea1a91341531255341d60d58891a02
|
|
4
|
+
data.tar.gz: eda5a84623011d29c4c842836123f0f39f81682a9dbfa40b2f1fe84bb4c8f91d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3a61991ed0eac2ce67ab6832ecfaca5ba6149996cf901ae474387e3143eb89c64163a439fb599470a68ef0f4ded6558fb2c02cce0270d37a235e344f757e2e3
|
|
7
|
+
data.tar.gz: b3051e52c18ea7a590e149e20d49437aacfc149de2b427698d004819264031006870fe23239b35bb606d53db4b8d21fa99d9f2fadb2568024a460ea6ba182cc8
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/demo/html.rb
CHANGED
|
@@ -43,6 +43,8 @@ elm_text1["required"] = true
|
|
|
43
43
|
# elm_select1['multiple'] = true # elm_select1.attr(multiple: true)
|
|
44
44
|
# puts elm_select1['multiple'] # puts elm_select1.attr('multiple')
|
|
45
45
|
|
|
46
|
+
# elm_select1.unsafe_content = "<option id=\"option12\">オプション12</option>"
|
|
47
|
+
|
|
46
48
|
# elm_option1 = root.element('option', id: 'option1')
|
|
47
49
|
# elm_option1['selected'] = true # elm_option1.attr(selected: true)
|
|
48
50
|
# elm_option1['selected'] = nil # elm_option1.remove_attr('selected')
|
|
@@ -95,6 +97,7 @@ end_time = Time.new.to_f
|
|
|
95
97
|
puts(root.document)
|
|
96
98
|
|
|
97
99
|
elms = root.elements("tr", id: "loop")
|
|
100
|
+
# elms = root.elements("tr")
|
|
98
101
|
# elms = root.elements('input', id: 'radio1', type: 'radio')
|
|
99
102
|
# elms = root.css('input[id=radio1][type=radio]')
|
|
100
103
|
elms.each { |elm|
|
data/lib/meteor/core/kernel.rb
CHANGED
|
@@ -1934,7 +1934,7 @@ module Meteor
|
|
|
1934
1934
|
# CX tag search pattern (CXタグ検索用パターン)
|
|
1935
1935
|
# @pattern_cc = String.new('') << "<!--\\s@" << @_name << '\\s([^<>]*id="'
|
|
1936
1936
|
# @pattern_cc << id << '"[^<>]*)-->(((?!(<!--\\s/@' << @_name << ")).)*)<!--\\s/@" << @_name << "\\s-->"
|
|
1937
|
-
# @pattern_cc = "<!--\\s@#{
|
|
1937
|
+
# @pattern_cc = "<!--\\s@#{@_name}\\s([^<>]*id=\"#{@_id}\"[^<>]*)-->(((?!(<!--\\s\\/@#{@_name})).)*)<!--\\s\\/@#{@_name}\\s-->"
|
|
1938
1938
|
@pattern_cc = "<!--\\s@#{@_name}\\s([^<>]*id=\"#{@_id}\"[^<>]*)-->(((?!(<!--\\s/@#{@_name})).)*)<!--\\s/@#{@_name}\\s-->"
|
|
1939
1939
|
|
|
1940
1940
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
data/lib/meteor/element.rb
CHANGED
|
@@ -53,8 +53,8 @@ module Meteor
|
|
|
53
53
|
attr_accessor :copy
|
|
54
54
|
attr_accessor :removed
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
alias_method :tag, :name
|
|
57
|
+
alias_method :tag=, :name=
|
|
58
58
|
|
|
59
59
|
#
|
|
60
60
|
# initializer (イニシャライザ)
|
|
@@ -291,7 +291,7 @@ module Meteor
|
|
|
291
291
|
end
|
|
292
292
|
end
|
|
293
293
|
|
|
294
|
-
|
|
294
|
+
alias_method :child, :element
|
|
295
295
|
|
|
296
296
|
#
|
|
297
297
|
# get elements (要素を取得する)
|
|
@@ -349,7 +349,7 @@ module Meteor
|
|
|
349
349
|
@parser.find(selector)
|
|
350
350
|
end
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
alias_method :css, :find
|
|
353
353
|
|
|
354
354
|
#
|
|
355
355
|
# get cx(comment extension) tag (CX(コメント拡張)タグを取得する)
|
|
@@ -455,7 +455,7 @@ module Meteor
|
|
|
455
455
|
@parser.content(self, *args)
|
|
456
456
|
end
|
|
457
457
|
|
|
458
|
-
|
|
458
|
+
alias_method :text, :content
|
|
459
459
|
|
|
460
460
|
#
|
|
461
461
|
# set content of element (要素の内容をセットする)
|
|
@@ -466,7 +466,18 @@ module Meteor
|
|
|
466
466
|
@parser.content(self, value)
|
|
467
467
|
end
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
alias_method :text=, :content=
|
|
470
|
+
|
|
471
|
+
#
|
|
472
|
+
# set content of element (要素の内容をセットする)
|
|
473
|
+
# @param [String] value content (要素の内容)
|
|
474
|
+
# @return [Meteor::Element] element (要素)
|
|
475
|
+
#
|
|
476
|
+
def unsafe_content=(value)
|
|
477
|
+
@parser.content(self, value, false)
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
alias_method :unsafe_text=, :unsafe_content=
|
|
470
481
|
|
|
471
482
|
#
|
|
472
483
|
# set attribute (属性をセットする)
|
|
@@ -514,7 +525,7 @@ module Meteor
|
|
|
514
525
|
@parser.flash
|
|
515
526
|
end
|
|
516
527
|
|
|
517
|
-
|
|
528
|
+
alias_method :flush, :flash
|
|
518
529
|
|
|
519
530
|
#
|
|
520
531
|
# @overload execute(hook)
|
|
@@ -207,13 +207,14 @@ module Meteor
|
|
|
207
207
|
# content-rich element search pattern (内容あり要素検索用パターン()
|
|
208
208
|
# @pattern_cc = String.new('') << "<" << @_name << '(|\\s[^<>]*)>(((?!(' << @_name
|
|
209
209
|
# @pattern_cc << '[^<>]*>)).)*)<\\/' << @_name << '>'
|
|
210
|
-
@pattern_cc = "<#{@_name}(|\\s[^<>]*)>(((?!(#{
|
|
210
|
+
@pattern_cc = "<#{@_name}(|\\s[^<>]*)>(((?!(#{@_name}[^<>]*>)).)*)<\\/#{@_name}>"
|
|
211
211
|
|
|
212
212
|
@pattern = Meteor::Core::Util::PatternCache.get(@pattern_cc)
|
|
213
213
|
# search of content-rich element (内容あり要素検索)
|
|
214
214
|
@res = @pattern.match(@root.document)
|
|
215
215
|
# case of content-rich element (内容あり要素の場合)
|
|
216
216
|
if @res
|
|
217
|
+
@on_search = true
|
|
217
218
|
element_with_1(name)
|
|
218
219
|
else
|
|
219
220
|
if @error_check
|
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.
|
|
39
|
+
# @version 0.9.24
|
|
40
40
|
#
|
|
41
41
|
|
|
42
42
|
module Meteor
|
|
43
|
-
VERSION = "0.9.
|
|
43
|
+
VERSION = "0.9.24"
|
|
44
44
|
|
|
45
45
|
# require 'fileutils'
|
|
46
46
|
|