set_sync 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/set_sync.rb +6 -2
- metadata +2 -2
data/lib/set_sync.rb
CHANGED
@@ -42,7 +42,9 @@ class SetSync
|
|
42
42
|
@local_hash ||= begin
|
43
43
|
h = {}
|
44
44
|
@local.each do |l|
|
45
|
-
if
|
45
|
+
if local_binding.respond_to? :call
|
46
|
+
h[ local_binding.call(l) ] = l
|
47
|
+
elsif l.respond_to? local_binding #is an objecty thing
|
46
48
|
h[l.send(local_binding)] = l
|
47
49
|
elsif l.respond_to? :[] #is a hashy thing
|
48
50
|
h[ l[local_binding] ] = l
|
@@ -56,7 +58,9 @@ class SetSync
|
|
56
58
|
@remote_hash ||= begin
|
57
59
|
h = {}
|
58
60
|
@remote.each do |r|
|
59
|
-
if
|
61
|
+
if remote_binding.respond_to? :call
|
62
|
+
h[ remote_binding.call(r) ] = r
|
63
|
+
elsif r.respond_to? remote_binding
|
60
64
|
h[ r.send(remote_binding) ] = r
|
61
65
|
elsif r.respond_to? :[]
|
62
66
|
h[ r[remote_binding] ] = r
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: set_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Syncs sets
|
15
15
|
email: phil@latentflip.com
|