rexle 0.2.13 → 0.3.0

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 +7 -4
  2. metadata +1 -1
@@ -164,9 +164,13 @@ class Rexle
164
164
  e = @child_elements[x.last]
165
165
  h = x[0][1] # <-- fetch the attributes
166
166
 
167
- if not attr_search or \
168
- (attr_search and ((attr_search.is_a?(Fixnum) and \
169
- i == attr_search) or (h and eval(attr_search)))) then
167
+ if attr_search then
168
+ if attr_search.is_a? Fixnum then
169
+ block_given? ? blk.call(e) : e if i == attr_search
170
+ elsif h and eval(attr_search)
171
+ block_given? ? blk.call(e) : e
172
+ end
173
+ else
170
174
  block_given? ? blk.call(e) : e
171
175
  end
172
176
 
@@ -255,4 +259,3 @@ class Rexle
255
259
  def count(path) @doc.xpath(path).flatten.compact.length end
256
260
 
257
261
  end
258
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rexle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors: []
7
7