rexle 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rexle.rb +4 -1
  2. metadata +2 -2
data/lib/rexle.rb CHANGED
@@ -13,7 +13,10 @@ class Rexle
13
13
  fn_match = path.match(/^(\w+)\(([^\)]+)\)$/)
14
14
 
15
15
  if fn_match.nil? then
16
- procs = {Array: proc {|x| x.flatten.compact}, String: proc {|x| x}}
16
+ procs = {
17
+ Array: proc {|x| r = x.flatten.compact; r.length == 1 ? r[0] : r},
18
+ String: proc {|x| x}
19
+ }
17
20
  result = @doc.xpath(path)
18
21
  procs[result.class.to_s.to_sym].call(result)
19
22
  else
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.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-10-22 00:00:00 +01:00
12
+ date: 2010-10-23 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15