rexle 0.9.21 → 0.9.22
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.
- data/lib/rexle.rb +14 -5
- metadata +2 -2
data/lib/rexle.rb
CHANGED
@@ -206,7 +206,7 @@ class Rexle
|
|
206
206
|
#remove any pre'fixes
|
207
207
|
#@rexle.prefixes.each {|x| xpath_value.sub!(x + ':','') }
|
208
208
|
flag_func = false
|
209
|
-
|
209
|
+
|
210
210
|
xpath_value = raw_xpath_value.sub(/^\[/,'*[')
|
211
211
|
|
212
212
|
if xpath_value[/^[\w\/]+\s*=.*/] then
|
@@ -219,9 +219,16 @@ class Rexle
|
|
219
219
|
|
220
220
|
#xpath_value.sub!(/^attribute::/,'*/attribute::')
|
221
221
|
raw_path, raw_condition = xpath_value.sub(/^\/(?!\/)/,'').match(/([^\[]+)(\[[^\]]+\])?/).captures
|
222
|
-
|
222
|
+
|
223
223
|
remaining_path = ($').to_s
|
224
|
-
|
224
|
+
|
225
|
+
r = raw_path[/([^\/]+)(?=\/\/)/,1]
|
226
|
+
if r then
|
227
|
+
a_path = raw_path.split(/(?=\/\/)/,2)
|
228
|
+
else
|
229
|
+
a_path = raw_path.split('/',2)
|
230
|
+
end
|
231
|
+
|
225
232
|
condition = raw_condition if a_path.length <= 1
|
226
233
|
|
227
234
|
if raw_path[0,2] == '//' then
|
@@ -243,7 +250,7 @@ class Rexle
|
|
243
250
|
|
244
251
|
if element_part then
|
245
252
|
unless element_part[/^@/] then
|
246
|
-
element_name = element_part[/^[\w
|
253
|
+
element_name = element_part[/^[\w:\*\.]+/]
|
247
254
|
else
|
248
255
|
condition = element_part
|
249
256
|
element_name = nil
|
@@ -263,12 +270,14 @@ class Rexle
|
|
263
270
|
return rs
|
264
271
|
else
|
265
272
|
|
266
|
-
return_elements = @child_lookup.map.with_index.select do |x|
|
273
|
+
return_elements = @child_lookup.map.with_index.select do |x|
|
274
|
+
|
267
275
|
(x[0][0] == element_name || element_name == '.') or \
|
268
276
|
(element_name == '*' && x[0].is_a?(Array))
|
269
277
|
end
|
270
278
|
|
271
279
|
end
|
280
|
+
|
272
281
|
|
273
282
|
if return_elements.length > 0 then
|
274
283
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rexle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.
|
5
|
+
version: 0.9.22
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-04-
|
13
|
+
date: 2012-04-13 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|