traject 2.0.1-java → 2.0.2-java

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: 44c1c809093189ee211bf8033ec9b15398047c18
4
- data.tar.gz: ccf0cde00fad91a001f148dab37f5e613b880234
3
+ metadata.gz: ce12df11c229a7944a720a3ccb9f4cad8fb37669
4
+ data.tar.gz: 4ba839a011a55ec5d212d68b4a337a6f7d5cb898
5
5
  SHA512:
6
- metadata.gz: 0a4c3b7e34b5831a9105648d34ca726bae71dc464ae1de91246226ae2d92aa6f2b2b43f55ecd20107884a551e08108a154d6910a784dcc0c4f574a6372180fa7
7
- data.tar.gz: 891e30a62e1ffd96ca5c5f5c51bd8bee9b44653170e16930f0b91690be882c5603e56a9cfd7fbaa566a72e74754364d74aa3f90a64c05181fad6a1dd04bc75b0
6
+ metadata.gz: 8c8725d03ede411d1730f6ecd46aa916b2b7c1d04a6a7f74bca7bb868ce0c2225d300308aebbaab571ea7bf04a5267ed5dd1981d4e141dd4db065ecb03db8e56
7
+ data.tar.gz: e127fcd3aa1fcfdcd90f889416f10e817082df8b7584e51e1bc4a142428608e64a04e54cf6e6a16f4241a4957d56b07fed79e450c842750e3464e36407057b25
data/CHANGES.md ADDED
@@ -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: java
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -201,6 +201,7 @@ files:
201
201
  - .gitignore
202
202
  - .travis.yml
203
203
  - .yardopts
204
+ - CHANGES.md
204
205
  - Gemfile
205
206
  - LICENSE.txt
206
207
  - README.md