cdmdexer 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cdmdexer/field_transformer.rb +3 -2
- data/lib/cdmdexer/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59d43d9c22b7fe79a88b39a9d44909f41062cbe24f97daa2d9458c70de3a7c56
|
4
|
+
data.tar.gz: cf687f21c8f8740dba42eb9b86d8272df812ea7456bfae6eb1314ec5f270189b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f75efb0c7b642a71a6231eaa07fd6a7fe8ffa994e90175a0e7ee953795500458adf3e23b6f9461b2116144494d331e221ac7c63c717bd1bb55ab4efd981cf561
|
7
|
+
data.tar.gz: 2d9817ad1099ac49117f6bde773134c66b0da166ab5928ca513226996a93279b3d49f18b4905de17db751674c5219cbf5acec44e36f85f156981038d3ae21c33
|
@@ -4,11 +4,12 @@ module CDMDEXER
|
|
4
4
|
class FieldTransformer
|
5
5
|
extend Forwardable
|
6
6
|
def_delegators :@field_mapping, :origin_path, :dest_path, :formatters
|
7
|
-
attr_reader :field_value, :field_mapping, :formatter_klass
|
7
|
+
attr_reader :field_value, :field_mapping, :formatter_klass, :record_id
|
8
8
|
def initialize(field_mapping: FieldMapping.new,
|
9
9
|
record: {},
|
10
10
|
formatter_klass: FieldFormatter)
|
11
11
|
@field_mapping = field_mapping
|
12
|
+
@record_id = record.fetch('id', 'MISSING_RECORD_ID')
|
12
13
|
@field_value = compact(record.at_path(origin_path))
|
13
14
|
@formatter_klass = formatter_klass
|
14
15
|
end
|
@@ -35,7 +36,7 @@ module CDMDEXER
|
|
35
36
|
def transform_field
|
36
37
|
formatter_klass.new(value: field_value, formatters: formatters).format!
|
37
38
|
rescue StandardError => e
|
38
|
-
raise "Mapping Error
|
39
|
+
raise "FieldTransformer Mapping Error - Record: #{record_id} Mapping: #{field_mapping.config} Error:#{e.message}"
|
39
40
|
end
|
40
41
|
end
|
41
42
|
end
|
data/lib/cdmdexer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdmdexer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chadfennell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hash_at_path
|
@@ -215,7 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0'
|
217
217
|
requirements: []
|
218
|
-
|
218
|
+
rubyforge_project:
|
219
|
+
rubygems_version: 2.7.8
|
219
220
|
signing_key:
|
220
221
|
specification_version: 4
|
221
222
|
summary: Load CONTENTdm data into a Solr Index. CDMDEXER expects to run inside a Rails
|