rexle 0.9.6 → 0.9.7

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.
Files changed (2) hide show
  1. data/lib/rexle.rb +10 -6
  2. metadata +2 -2
@@ -106,7 +106,7 @@ class Rexle
106
106
  end
107
107
 
108
108
  end
109
-
109
+
110
110
  def xpath(path, &blk)
111
111
 
112
112
  # is it a function
@@ -164,7 +164,8 @@ class Rexle
164
164
 
165
165
  #remove any prefixes
166
166
  #@rexle.prefixes.each {|x| xpath_value.sub!(x + ':','') }
167
-
167
+
168
+ puts 'xpath_value : ' + xpath_value.inspect
168
169
  xpath_value.sub!(/^\[/,'*[')
169
170
  #xpath_value.sub!(/^attribute::/,'*/attribute::')
170
171
  raw_path, raw_condition = xpath_value.sub(/^\/(?!\/)/,'').match(/([^\[]+)(\[[^\]]+\])?/).captures
@@ -179,9 +180,10 @@ class Rexle
179
180
  a_path.shift
180
181
  return @value
181
182
  else
182
-
183
183
  attribute = xpath_value[/^(attribute::|@)(.*)/,2]
184
- return [@attributes[attribute]] if attribute and @attributes and @attributes.has_key?(attribute)
184
+ puts 'attribute : ' + attribute.inspect
185
+ puts '@attributes ; ' + @attributes.inspect
186
+ return [@attributes[attribute.to_sym]] if attribute and @attributes and @attributes.has_key?(attribute.to_sym)
185
187
 
186
188
  s = a_path.shift
187
189
  end
@@ -204,11 +206,13 @@ class Rexle
204
206
  raw_condition = '' if condition
205
207
 
206
208
  attr_search = format_condition(condition) if condition and condition.length > 0
209
+
210
+ puts 'attr_search : ' + attr_search.inspect
207
211
 
208
212
  if raw_path[0,2] == '//'
209
213
  return scan_match(self, xpath_value)
210
214
  else
211
-
215
+ puts "@child_lookup " + @child_lookup.inspect
212
216
  return_elements = @child_lookup.map.with_index.select do |x|
213
217
  x[0][0] == element_name or element_name == '*'
214
218
  end
@@ -387,7 +391,7 @@ class Rexle
387
391
 
388
392
  if x.length >= 3 then
389
393
  x[1] = '==' if x[1] == '='
390
- "h['%s'] %s %s" % x
394
+ "h[:'%s'] %s %s" % x
391
395
  else
392
396
  x
393
397
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rexle
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.6
5
+ version: 0.9.7
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: 2011-07-19 00:00:00 +01:00
13
+ date: 2011-07-24 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency