audumbla 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/audumbla/enrichment.rb +12 -2
- data/lib/audumbla/version.rb +1 -1
- 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: e7e80ddf5891633eaed88fef789f0a21e5c7246c
|
4
|
+
data.tar.gz: 2d182f19c5c77d8f0d66c403bcccfe6b49f6e4b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea19b2ec6bf28e3856850ff076ac208743ee9f406adc5b5961c86031b325baa9d7665e8c0390f7341af354bd7f7fdfbc42bbf1749f544ba1d66b9318812ab79f
|
7
|
+
data.tar.gz: b072df0a131b7fb3773093e4b307889e2dbf0444e7b03e34c619ffb5749a9eb6f5fbc961e495f9df65617852b31f36df36f4c195c9068f909c2a669569aa6c87
|
data/lib/audumbla/enrichment.rb
CHANGED
@@ -116,8 +116,18 @@ module Audumbla
|
|
116
116
|
def values_for_field(record, field_chain)
|
117
117
|
values = record.send(field_chain.first)
|
118
118
|
return values if field_chain.length == 1
|
119
|
-
|
120
|
-
|
119
|
+
|
120
|
+
values = resources(values).map do |v|
|
121
|
+
values_for_field(v, field_chain[1..-1])
|
122
|
+
end
|
123
|
+
|
124
|
+
# We call #flatten twice, since under some circumstances it fails on
|
125
|
+
# nested #to_ary calls the first time. This appears to be related to:
|
126
|
+
#
|
127
|
+
# http://yehudakatz.com/2010/01/02/the-craziest-fing-bug-ive-ever-seen/
|
128
|
+
# and
|
129
|
+
# https://bugs.ruby-lang.org/issues/2494
|
130
|
+
begin; values.flatten.compact; rescue; values.flatten.compact; end
|
121
131
|
end
|
122
132
|
|
123
133
|
def set_field(record, field_chain, values)
|
data/lib/audumbla/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: audumbla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Audrey Altman
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-
|
14
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: dpla-map
|