xml-smart 0.3.0.7 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -4
- data/lib/xml/smart_domelement.rb +2 -2
- data/xml-smart.gemspec +1 -1
- metadata +89 -69
data/README.rdoc
CHANGED
@@ -38,14 +38,14 @@ Register your own shortcusts to be available in all XPaths:
|
|
38
38
|
|
39
39
|
doc = XML::Smart.string('<test xmlns:aaa="uri:aaa"><aaa:test/></test>')
|
40
40
|
doc.register_namespace :a, 'uri:aaa'
|
41
|
-
doc.find('string(
|
41
|
+
doc.find('string(a:test)')
|
42
42
|
doc.close
|
43
43
|
|
44
44
|
=== NFS safe file locking while editing / reading from an XML file
|
45
45
|
|
46
|
-
XML::Smart.modify("EXAMPLE.xml","<test><names/></test>")
|
47
|
-
|
48
|
-
|
46
|
+
XML::Smart.modify("EXAMPLE.xml","<test><names/></test>") do |doc|
|
47
|
+
doc.root.add "test_node"
|
48
|
+
end
|
49
49
|
|
50
50
|
== Changes since 0.2.x (see Changelog)
|
51
51
|
|
data/lib/xml/smart_domelement.rb
CHANGED
@@ -174,8 +174,8 @@ module XML
|
|
174
174
|
def text; @element.xpath_fast("string(text())"); end
|
175
175
|
def text=(t); @element.content = t.to_s if t.respond_to? :to_s; end
|
176
176
|
|
177
|
-
def children; find('
|
178
|
-
def children?; find('
|
177
|
+
def children; find('*|text()'); end
|
178
|
+
def children?; find('*|text()').length > 0 end
|
179
179
|
def parent
|
180
180
|
Dom::smart_helper(@element.parent)
|
181
181
|
end
|
data/xml-smart.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml-smart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: lockfile
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: term-ansicolor
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: minitest
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,7 +69,12 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
description: An xml library that doesn't suck (since 2004). Based on Nokogiri since
|
59
79
|
2012. For more info check out the Documentation link below.
|
60
80
|
email: juergen.mangler@gmail.com
|
@@ -63,63 +83,63 @@ extensions: []
|
|
63
83
|
extra_rdoc_files:
|
64
84
|
- README.rdoc
|
65
85
|
files:
|
66
|
-
- lib/xml/smart_domnamespaceset.rb
|
67
|
-
- lib/xml/smart_domattribute.rb
|
68
|
-
- lib/xml/smart_domnamespace.rb
|
69
86
|
- lib/xml/smart_domnodeset.rb
|
70
|
-
- lib/xml/smart_domtext.rb
|
71
87
|
- lib/xml/smart_dom.rb
|
72
|
-
- lib/xml/smart_domelement.rb
|
73
|
-
- lib/xml/smart_domother.rb
|
74
88
|
- lib/xml/smart_qname.rb
|
89
|
+
- lib/xml/smart_domother.rb
|
90
|
+
- lib/xml/smart_domattribute.rb
|
75
91
|
- lib/xml/XSDtoRNG.xsl
|
76
|
-
- lib/xml/smart_domattributeset.rb
|
77
92
|
- lib/xml/smart.rb
|
78
|
-
-
|
93
|
+
- lib/xml/smart_domelement.rb
|
94
|
+
- lib/xml/smart_domnamespaceset.rb
|
95
|
+
- lib/xml/smart_domtext.rb
|
96
|
+
- lib/xml/smart_domattributeset.rb
|
97
|
+
- lib/xml/smart_domnamespace.rb
|
79
98
|
- example/xpath_visual.rb
|
99
|
+
- example/EXAMPLE.xml
|
80
100
|
- COPYING
|
81
101
|
- Rakefile
|
82
102
|
- xml-smart.gemspec
|
83
103
|
- README.rdoc
|
84
104
|
- AUTHORS
|
85
|
-
- test/
|
86
|
-
- test/tc_xpath_attrs.rb
|
87
|
-
- test/tc_xpath_functions.rb
|
88
|
-
- test/tc_sort.rb
|
89
|
-
- test/tc_xmlschema.rb
|
90
|
-
- test/tc_move_elements.rb
|
91
|
-
- test/tc_add.rb
|
92
|
-
- test/tc_namespace_detailed.rb
|
105
|
+
- test/tc_xpath.rb
|
93
106
|
- test/tc_copy.rb
|
94
|
-
- test/tc_namespace_default.rb
|
95
|
-
- test/tc_string.rb
|
96
107
|
- test/tc_set_or_replace.rb
|
97
|
-
- test/tc_write.rb
|
98
|
-
- test/tc_xsl.rb
|
99
|
-
- test/tc_create.rb
|
100
108
|
- test/tc_nested.rb
|
101
|
-
- test/tc_xpath_root.rb
|
102
|
-
- test/tc_qname.rb
|
103
109
|
- test/tc_todoc.rb
|
104
|
-
- test/tc_concurrent.rb
|
105
|
-
- test/tc_basic.rb
|
106
110
|
- test/tc_namespace_find.rb
|
111
|
+
- test/tc_string.rb
|
112
|
+
- test/tc_namespace_detailed.rb
|
113
|
+
- test/tc_write.rb
|
114
|
+
- test/tc_basic.rb
|
115
|
+
- test/tc_create.rb
|
116
|
+
- test/tc_move_elements.rb
|
117
|
+
- test/tc_xpath_attrs.rb
|
118
|
+
- test/tc_sort.rb
|
119
|
+
- test/tc_qname.rb
|
120
|
+
- test/tc_xpath_root.rb
|
121
|
+
- test/tc_namespace_default.rb
|
122
|
+
- test/tc_xsl.rb
|
123
|
+
- test/tc_xmlschema.rb
|
107
124
|
- test/tc_relaxng.rb
|
125
|
+
- test/tc_xpath_functions.rb
|
126
|
+
- test/tc_concurrent.rb
|
127
|
+
- test/tc_add.rb
|
128
|
+
- test/tc_delete.rb
|
108
129
|
- test/tc_xinclude.rb
|
109
|
-
- test/tc_xpath.rb
|
110
|
-
- test/HELLO.xml
|
111
130
|
- test/EXAMPLE.tmp.xml
|
112
|
-
- test/
|
113
|
-
- test/HELLO-MORE.xml
|
131
|
+
- test/3.xml
|
114
132
|
- test/EXAMPLE-NSE.xml
|
115
|
-
- test/EXAMPLE.xml
|
116
133
|
- test/EXAMPLE.str.xml
|
134
|
+
- test/2.xml
|
117
135
|
- test/concurrent.xml
|
118
|
-
- test/
|
119
|
-
- test/XSL_DOCUMENT.xml
|
136
|
+
- test/HELLO.xml
|
120
137
|
- test/1.xml
|
121
138
|
- test/XSL_BASE.xml
|
122
|
-
- test/
|
139
|
+
- test/HELLO-MORE.xml
|
140
|
+
- test/XSL_DOCUMENT.xml
|
141
|
+
- test/EXAMPLE.xml
|
142
|
+
- test/EXAMPLE-NS.xml
|
123
143
|
- test/HELLO.rng
|
124
144
|
- test/HELLO.xsd
|
125
145
|
- test/XSL_BASE.xml.test
|
@@ -146,49 +166,49 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
166
|
version: '0'
|
147
167
|
requirements: []
|
148
168
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.8.
|
169
|
+
rubygems_version: 1.8.23
|
150
170
|
signing_key:
|
151
171
|
specification_version: 3
|
152
172
|
summary: An xml library that doesn't suck - since 2004.
|
153
173
|
test_files:
|
154
|
-
- test/
|
155
|
-
- test/tc_xpath_attrs.rb
|
156
|
-
- test/tc_xpath_functions.rb
|
157
|
-
- test/tc_sort.rb
|
158
|
-
- test/tc_xmlschema.rb
|
159
|
-
- test/tc_move_elements.rb
|
160
|
-
- test/tc_add.rb
|
161
|
-
- test/tc_namespace_detailed.rb
|
174
|
+
- test/tc_xpath.rb
|
162
175
|
- test/tc_copy.rb
|
163
|
-
- test/tc_namespace_default.rb
|
164
|
-
- test/tc_string.rb
|
165
176
|
- test/tc_set_or_replace.rb
|
166
|
-
- test/tc_write.rb
|
167
|
-
- test/tc_xsl.rb
|
168
|
-
- test/tc_create.rb
|
169
177
|
- test/tc_nested.rb
|
170
|
-
- test/tc_xpath_root.rb
|
171
|
-
- test/tc_qname.rb
|
172
178
|
- test/tc_todoc.rb
|
173
|
-
- test/tc_concurrent.rb
|
174
|
-
- test/tc_basic.rb
|
175
179
|
- test/tc_namespace_find.rb
|
180
|
+
- test/tc_string.rb
|
181
|
+
- test/tc_namespace_detailed.rb
|
182
|
+
- test/tc_write.rb
|
183
|
+
- test/tc_basic.rb
|
184
|
+
- test/tc_create.rb
|
185
|
+
- test/tc_move_elements.rb
|
186
|
+
- test/tc_xpath_attrs.rb
|
187
|
+
- test/tc_sort.rb
|
188
|
+
- test/tc_qname.rb
|
189
|
+
- test/tc_xpath_root.rb
|
190
|
+
- test/tc_namespace_default.rb
|
191
|
+
- test/tc_xsl.rb
|
192
|
+
- test/tc_xmlschema.rb
|
176
193
|
- test/tc_relaxng.rb
|
194
|
+
- test/tc_xpath_functions.rb
|
195
|
+
- test/tc_concurrent.rb
|
196
|
+
- test/tc_add.rb
|
197
|
+
- test/tc_delete.rb
|
177
198
|
- test/tc_xinclude.rb
|
178
|
-
- test/tc_xpath.rb
|
179
|
-
- test/HELLO.xml
|
180
199
|
- test/EXAMPLE.tmp.xml
|
181
|
-
- test/
|
182
|
-
- test/HELLO-MORE.xml
|
200
|
+
- test/3.xml
|
183
201
|
- test/EXAMPLE-NSE.xml
|
184
|
-
- test/EXAMPLE.xml
|
185
202
|
- test/EXAMPLE.str.xml
|
203
|
+
- test/2.xml
|
186
204
|
- test/concurrent.xml
|
187
|
-
- test/
|
188
|
-
- test/XSL_DOCUMENT.xml
|
205
|
+
- test/HELLO.xml
|
189
206
|
- test/1.xml
|
190
207
|
- test/XSL_BASE.xml
|
191
|
-
- test/
|
208
|
+
- test/HELLO-MORE.xml
|
209
|
+
- test/XSL_DOCUMENT.xml
|
210
|
+
- test/EXAMPLE.xml
|
211
|
+
- test/EXAMPLE-NS.xml
|
192
212
|
- test/HELLO.rng
|
193
213
|
- test/HELLO.xsd
|
194
214
|
- test/XSL_BASE.xml.test
|