object-template 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/object-template.rb +5 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0a5de83ebb8ff998cc58867095e39d3f0db3791
4
- data.tar.gz: 017f452601552d9925eaa66ee644a083cd8fb811
3
+ metadata.gz: b73996b9c7fc5ffc66469ea21da8612d85cfc0ca
4
+ data.tar.gz: 6982a85aa7cb5f4ef27b1d3d07e219cbf39cbacd
5
5
  SHA512:
6
- metadata.gz: f6f1388f966a99862f993cfb1148b0875aa95ee4f683496aa7df5c4beedef0091e681db2ac968b9234fba1df9b9118a00cab0de32fa7f512bf7c082a3f252784
7
- data.tar.gz: 66704904c9834996643f418a9aa848e1fa0e814d62d68983fad6322ad8183f20766b5e1f277ad0ff1b49553ba60d495111f6b69183d7b1f52d8802512ead6367
6
+ metadata.gz: df96bc58a7d309b763ef03f7fc3c4742593a5692b5fdb5acdf7704f53b00f476fdf4c1c3f90cca9f308c92d377a0f6a28889b4815b134c2db83da87bbc821e26
7
+ data.tar.gz: 0874436e5f11014864e032d99c67d731f21d665d6e7cc635f2f16bf585f28189a6c2aeb3599e6876ade7bfd130659501258c78e5249412f667e0c099c3ee7648
@@ -2,7 +2,7 @@ require 'set'
2
2
 
3
3
  # Base class for classes of templates used to match somewhat arbitrary objects.
4
4
  class ObjectTemplate
5
- VERSION = "0.6"
5
+ VERSION = "0.7"
6
6
 
7
7
  attr_reader :spec
8
8
 
@@ -29,9 +29,12 @@ class ObjectTemplate
29
29
  if spec.respond_to? :to_hash # assume hash-like
30
30
  @shibboleth = :to_hash
31
31
  spec.each do |k, v|
32
- kc = key_converter ? key_converter[k]: k
32
+ kc = key_converter ? key_converter[k=>nil].keys[0] : k
33
33
  # Note: cannot use key_converter[v] because v may have class, regex,
34
34
  # or other non-serializable object.
35
+ # Note: the [k=>nil].keys[0] is needed instead of just [k]
36
+ # because the key_converter might not convert values, only keys.
37
+ # We do not assume that k is a scalar.
35
38
  fill_matchers kc, v
36
39
  end
37
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object-template
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel VanderWerf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-03 00:00:00.000000000 Z
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Templates for matching objects.
14
14
  email: vjoel@users.sourceforge.net