traject 2.0.1 → 2.0.2

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: 373bacd3f89f1c190ac11118b87f69a8bffdb1ad
4
- data.tar.gz: 3db4b9acbf2ba3830c8c815d8977ad5d6b24f5bc
3
+ metadata.gz: f738d7b32e8ccc9ac89b1ed735a154790a36c656
4
+ data.tar.gz: 79d32ec442d5569b50ac4c8c2f25d588de335a79
5
5
  SHA512:
6
- metadata.gz: 7fe42ac6c3cba77c20c6a752887be6f3820d8858654d80e6681069b5c3e62fb2367e6a8d6747b771abccce45ecc58aa62e475a46b97fd2586d12ac59475387b3
7
- data.tar.gz: ee096fc51b36492e36a9f70cdfbc5844eeb60d844c45e237b46f3b55da2b09e72893d70c5091fc7b5c152c6f4296cd9c5977ce02845ce8422c3b4cec96908c47
6
+ metadata.gz: 3042d06bc09ffc3421a334595a6393a047e0425f0b41221ab17b6881de7e96e07040f51ea1f3b4a18dd24580158eebaa341c6e640cc31263385f497584b33f75
7
+ data.tar.gz: 811378d18249d07db3c85dc31205e2d70a98b86b6edd57fb97789f3aaa98c7b6fd7b1045966674c06eced1c6cc87848ef1efc361994f383a5c05488046fc286a
@@ -0,0 +1,20 @@
1
+ # Changes
2
+
3
+ ## 2.0.2
4
+
5
+ * Guard against assumption of MARC data when indexing using SolrJsonWriter ([#94](https://github.com/traject-project/traject/issues/94))
6
+ * For MARC Records, try to use the production date when available ([#93](https://github.com/traject-project/traject/issues/93))
7
+
8
+ ## 2.0.1
9
+
10
+ * Fix bad constant in logging ([#91](https://github.com/traject-project/traject/issues/91))
11
+
12
+ ## 2.0.0
13
+
14
+ * Compatible with MRI/RBX
15
+ * Default to SolrJsonWriter
16
+ * Release separate MRI/JRuby gems
17
+
18
+ ## 1.0
19
+
20
+ * First release
@@ -343,7 +343,7 @@ module Traject::Macros
343
343
  # the FIRST date then, the earliest. That's just what we're doing.
344
344
  if found_date.nil? && date_type != 'n' && date_type != 'q'
345
345
  # in date_type 'r', second date is original publication date, use that I think?
346
- date_str = (date_type == 'r' && date2_str.to_i != 0) ? date2_str : date1_str
346
+ date_str = ((date_type == 'r' || date_type == 'p') && date2_str.to_i != 0) ? date2_str : date1_str
347
347
  # Deal with stupid 'u's, which end up meaning a range too,
348
348
  # find midpoint and make sure our tolerance is okay.
349
349
  ucount = 0
@@ -167,9 +167,13 @@ class Traject::SolrJsonWriter
167
167
  end
168
168
 
169
169
  # Returns MARC 001, then a slash, then output_hash["id"] -- if both
170
- # are present. Otherwise may return just one, or even an empty string.
170
+ # are present. Otherwise may return just one, or even an empty string.
171
171
  def record_id_from_context(context)
172
- marc_id = context.source_record && context.source_record['001'] && context.source_record['001'].value
172
+ marc_id = if context.source_record &&
173
+ context.source_record.kind_of?(MARC::Record) &&
174
+ context.source_record['001']
175
+ context.source_record['001'].value
176
+ end
173
177
  output_id = context.output_hash["id"]
174
178
 
175
179
  return [marc_id, output_id].compact.join("/")
@@ -1,3 +1,3 @@
1
1
  module Traject
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traject
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -187,6 +187,7 @@ files:
187
187
  - ".gitignore"
188
188
  - ".travis.yml"
189
189
  - ".yardopts"
190
+ - CHANGES.md
190
191
  - Gemfile
191
192
  - LICENSE.txt
192
193
  - README.md