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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 100602e369b80c14118de38514d6273bad179cde
4
- data.tar.gz: 4e2e0efbf018f7d632d460b9727f691578016a90
3
+ metadata.gz: e7e80ddf5891633eaed88fef789f0a21e5c7246c
4
+ data.tar.gz: 2d182f19c5c77d8f0d66c403bcccfe6b49f6e4b6
5
5
  SHA512:
6
- metadata.gz: 2ad72a4e8bb400e99d79e74c2fff277ec80d55cbed4ffb3771641e8f0bba56a2c20e8483201cdda17a16738fb389e04299ce925e40dcc384db73183c05b6632f
7
- data.tar.gz: 34352f392ae17552d14511d630df1d50cdccec42d98a6193da0f5267a4e047855c033a9592ad181d1105d5008877449d1c521c306995736d93b24d7df3fc3aa6
6
+ metadata.gz: ea19b2ec6bf28e3856850ff076ac208743ee9f406adc5b5961c86031b325baa9d7665e8c0390f7341af354bd7f7fdfbc42bbf1749f544ba1d66b9318812ab79f
7
+ data.tar.gz: b072df0a131b7fb3773093e4b307889e2dbf0444e7b03e34c619ffb5749a9eb6f5fbc961e495f9df65617852b31f36df36f4c195c9068f909c2a669569aa6c87
@@ -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
- resources(values).map { |v| values_for_field(v, field_chain[1..-1]) }
120
- .flatten.compact
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)
@@ -1,3 +1,3 @@
1
1
  module Audumbla
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
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.0
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-07-22 00:00:00.000000000 Z
14
+ date: 2015-08-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: dpla-map