testdata 0.1.6 → 0.1.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/testdata.rb +2 -1
  2. metadata +2 -2
data/lib/testdata.rb CHANGED
@@ -9,7 +9,7 @@ class Select
9
9
 
10
10
  def initialize(type, node) @node, @type = node, type end
11
11
 
12
- def data(x)
12
+ def data(*raw_x)
13
13
 
14
14
  stringify = Proc.new {|x| x.texts.length <= 1 ? x.text : x.cdatas.join.strip}
15
15
 
@@ -23,6 +23,7 @@ class Select
23
23
  XPath.match(@node, xpath).map {|x| stringify.call(x)}
24
24
  end
25
25
 
26
+ x = raw_x.length > 1 ? raw_x : raw_x[0]
26
27
  values = procs[x.class.to_s.to_sym].call(@type, x)
27
28
  block_given? ? yield(values) : values
28
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
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-28 00:00:00 +01:00
12
+ date: 2010-10-29 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15