cul_scv_hydra 0.19.1 → 0.19.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: c83f01d70ffea304d2cfd2adb319328a1ce6e693
4
- data.tar.gz: ea391bb2680b8ea434f28bd4635c36f6d5ae5859
3
+ metadata.gz: 372040457992fc3bf6904552bebc868ea58bbf6e
4
+ data.tar.gz: b3c8c77276595757a9d31afdda0d0e2575ba7961
5
5
  SHA512:
6
- metadata.gz: d24fdd7c273d77a095cbf0fdfafd86a8ea898617c98435bf8157a00fb9e0006c151948aaf2c41362bf842a278770bd57ca0425c3afbadb70c64ee1d89ca9efde
7
- data.tar.gz: f6591b9bd1ce46d737447b24810b84a95f7d2e40c5101a55924031ee8c6e978eeba0c4a9d6004992d076ef952a683ae459a66a46cfe49ce4496d23a66c3021d4
6
+ metadata.gz: 6626b1d16b9bdb878a66206d605a0259a5cf228f49874bcb6ba2cec699ee5dd14491a40a918450e09bacc0a3961016af8901f9af0e237f34c04e5454b8629046
7
+ data.tar.gz: 1aad0639cd8364a706a68c768f79abbbd294dd7a96fd77eac8666f1d8a25b8915ecc3e550520ada058404a057ec68008c22cba50d98ca70fad5e44385a2ade58
@@ -350,17 +350,24 @@ module Cul::Scv::Hydra::Solrizer
350
350
 
351
351
  end_date = start_date if end_date.blank?
352
352
 
353
+ puts 'start_date: ' + start_date
354
+ puts 'end_date: ' + end_date
355
+
353
356
  year_regex = /^(-?\d{1,4}).*/
354
357
 
355
358
  start_year_match = start_date.match(year_regex)
356
- start_year = start_year_match.captures[0] if start_year_match
357
- start_year = zero_pad_year(start_year)
358
- solr_doc["lib_start_date_year_itsi"] = start_year.to_i if start_year # TrieInt version for searches
359
+ if start_year_match && start_year_match.captures.length > 0
360
+ start_year = start_year_match.captures[0]
361
+ start_year = zero_pad_year(start_year)
362
+ solr_doc["lib_start_date_year_itsi"] = start_year.to_i # TrieInt version for searches
363
+ end
359
364
 
360
365
  end_year_match = end_date.match(year_regex)
361
- end_year = end_year_match.captures[0] if end_year_match
362
- end_year = zero_pad_year(end_year)
363
- solr_doc["lib_end_date_year_itsi"] = end_year.to_i if end_year # TrieInt version for searches
366
+ if end_year_match && end_year_match.captures.length > 0
367
+ end_year = end_year_match.captures[0]
368
+ end_year = zero_pad_year(end_year)
369
+ solr_doc["lib_end_date_year_itsi"] = end_year.to_i # TrieInt version for searches
370
+ end
364
371
 
365
372
  solr_doc["lib_date_year_range_si"] = start_year + '-' + end_year if start_year
366
373
 
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.19.1'
5
+ VERSION = '0.19.2'
6
6
  def self.version
7
7
  VERSION
8
8
  end
@@ -2,7 +2,7 @@
2
2
  module Cul
3
3
  module Scv
4
4
  module Hydra
5
- VERSION = '0.19.0'
5
+ VERSION = '0.19.1'
6
6
  def self.version
7
7
  VERSION
8
8
  end
data/lib/tasks/index.rake CHANGED
@@ -12,9 +12,16 @@ namespace :cul_scv_hydra do
12
12
  START_TIME = Time.now
13
13
 
14
14
  ENV["RAILS_ENV"] ||= Rails.env
15
- pid = ENV['pid']
16
- if ENV['omit']
17
- pids_to_omit = ENV['omit'].split(',').map{|pid|pid.strip}
15
+
16
+ if ENV['PIDS']
17
+ pids = ENV['PIDS'].split(',')
18
+ else
19
+ puts 'Please specify one or more comma-delimited pids to recurse over (e.g. PIDS=ldpd:123 or PIDS=ldpd:123,ldpd:456)'
20
+ next
21
+ end
22
+
23
+ if ENV['OMIT']
24
+ pids_to_omit = ENV['OMIT'].split(',').map{|pid|pid.strip}
18
25
  else
19
26
  pids_to_omit = nil
20
27
  end
@@ -22,7 +29,9 @@ namespace :cul_scv_hydra do
22
29
  skip_generic_resources = true if ENV['skip_generic_resources'] == 'true'
23
30
 
24
31
  begin
25
- Cul::Scv::Hydra::Indexer.recursively_index_fedora_objects(pid, pids_to_omit, skip_generic_resources, true)
32
+ pids.each do |pid|
33
+ Cul::Scv::Hydra::Indexer.recursively_index_fedora_objects(pid, pids_to_omit, skip_generic_resources, true)
34
+ end
26
35
  rescue => e
27
36
  puts 'Error: ' + e.message
28
37
  puts e.backtrace
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cul_scv_hydra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Armintor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-22 00:00:00.000000000 Z
12
+ date: 2014-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight