ox 2.9.1 → 2.9.2
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.md +6 -0
- data/lib/ox/element.rb +9 -2
- data/lib/ox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb02e4bfe5c3553796c87488d1a973e5d0c7774391352c85558776b462a722ed
|
4
|
+
data.tar.gz: 860e2ce73ed2f755140241bf211ce26425e8bb49ce1d3d1263b72a2f3e48dc44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bbbd7e22da84b169665e1633f8ad0f533ea500e01d5712282dbe1921d346bdcfd3dc51b918d6cbe241fa54d2b45b35a42553f44a0308f0d54e186e58d363fc2
|
7
|
+
data.tar.gz: f45f9c90c1875965a4c0900334861d9416c888fe420b8343139abf09c2daaf51a4e56f2fd2abcb1229f33864c5ee3f2f37bc5a7caa42bd3d22685c942976de49
|
data/CHANGELOG.md
CHANGED
data/lib/ox/element.rb
CHANGED
@@ -158,7 +158,10 @@ module Ox
|
|
158
158
|
# * <code>element.locate("Family/Pete/*")</code> returns all children of the Pete Element.
|
159
159
|
# * <code>element.locate("Family/?[1]")</code> returns the first element in the Family Element.
|
160
160
|
# * <code>element.locate("Family/?[<3]")</code> returns the first 3 elements in the Family Element.
|
161
|
+
# * <code>element.locate("Family/?[@age]")</code> returns the elements with an age attribute defined in the Family Element.
|
162
|
+
# * <code>element.locate("Family/Kid[@age]")</code> returns the Kid elements with an age attribute defined in the Family Element.
|
161
163
|
# * <code>element.locate("Family/?[@age=32]")</code> returns the elements with an age attribute equal to 32 in the Family Element.
|
164
|
+
# * <code>element.locate("Family/Kid[@age=32]")</code> returns the Kid elements with an age attribute equal to 32 in the Family Element.
|
162
165
|
# * <code>element.locate("Family/?/@age")</code> returns the arg attribute for each child in the Family Element.
|
163
166
|
# * <code>element.locate("Family/*/@type")</code> returns the type attribute value for decendents of the Family.
|
164
167
|
# * <code>element.locate("Family/^Comment")</code> returns any comments that are a child of Family.
|
@@ -283,8 +286,12 @@ module Ox
|
|
283
286
|
when '>'
|
284
287
|
match = index <= match.size ? match[index + 1..-1] : []
|
285
288
|
when '@'
|
286
|
-
k,v = step[
|
287
|
-
|
289
|
+
k,v = step[i..-2].split('=')
|
290
|
+
if v
|
291
|
+
match = match.select { |n| n.is_a?(Element) && (v == n.attributes[k.to_sym] || v == n.attributes[k]) }
|
292
|
+
else
|
293
|
+
match = match.select { |n| n.is_a?(Element) && (n.attributes[k.to_sym] || n.attributes[k]) }
|
294
|
+
end
|
288
295
|
else
|
289
296
|
raise InvalidPath.new(path)
|
290
297
|
end
|
data/lib/ox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "A fast XML parser and object serializer that uses only standard C lib.\n
|
14
14
|
\ \nOptimized XML (Ox), as the name implies was written to provide speed
|