object-template 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/object-template.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b73996b9c7fc5ffc66469ea21da8612d85cfc0ca
|
4
|
+
data.tar.gz: 6982a85aa7cb5f4ef27b1d3d07e219cbf39cbacd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df96bc58a7d309b763ef03f7fc3c4742593a5692b5fdb5acdf7704f53b00f476fdf4c1c3f90cca9f308c92d377a0f6a28889b4815b134c2db83da87bbc821e26
|
7
|
+
data.tar.gz: 0874436e5f11014864e032d99c67d731f21d665d6e7cc635f2f16bf585f28189a6c2aeb3599e6876ade7bfd130659501258c78e5249412f667e0c099c3ee7648
|
data/lib/object-template.rb
CHANGED
@@ -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.
|
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.
|
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-
|
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
|