harvestdor-indexer 2.2.0 → 2.3.0

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: 3088417ff80fa408e42f434dc8f55cf10010fa88
4
- data.tar.gz: 390fb594e23b05bcaadbd5b498a205c31ada7cda
3
+ metadata.gz: d96e29c5f341999505f85ed425337dd44ca1046b
4
+ data.tar.gz: 08fb83487024f6aede8af03146a5f1bc37cdb963
5
5
  SHA512:
6
- metadata.gz: eb7b00d94dbd7a2266ffa10e469694cafe59ed7dacc99a1eaebe28f7a9452381855cfb7a5c940518450c8d8a01d1ac161a5e4eeb796d5828e2ddfb82f9e4619b
7
- data.tar.gz: 294304cf33a1af2540f07edcb3a138c2f50040d48264f8223e4b9936b17d7305d063d458fd4f7b09ab84d290b8ac69f5b119da873bc7b0f0134b125d221d6d78
6
+ metadata.gz: e534e9836695329596135b256524bfcb1a774add00c81e4e6d6a17f4c08f127df671f43066616265d237fddeaf147b9992a9822cf8f166c03b255222fb6ece46
7
+ data.tar.gz: 4365f67d19849eb939c5abf91d77870ad5cc01b2fea6012b729ee9eb09b6a44ef94dc1ae04cebff9badeb1004a1f27d5e302d9e9d70d6a296c1cfb4b45ce508f
@@ -2,14 +2,10 @@ language: ruby
2
2
  sudo: false
3
3
  script: rake
4
4
  rvm:
5
- - 2.2.0
6
- - 2.1.5
7
- - 2.0.0
8
- - 1.9.3
9
- - jruby-1.7.9-d19 # fails after 1.7.10 for some reason
10
- # - jruby-19mode # JRuby in 1.9 mode
5
+ - 2.2.3
6
+
11
7
  notifications:
12
8
  email:
13
9
  - ndushay@stanford.edu
14
10
  - laneymcg@stanford.edu
15
- - cbeer@stanford.edu
11
+ - cabeer@stanford.edu
@@ -1,12 +1,10 @@
1
- = Harvestdor::Indexer
2
- {<img src="https://travis-ci.org/sul-dlss/harvestdor-indexer.svg" alt="Build Status" />}[https://travis-ci.org/sul-dlss/harvestdor-indexer]
3
- {<img src="https://coveralls.io/repos/sul-dlss/harvestdor-indexer/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/sul-dlss/harvestdor-indexer]
4
- {<img src="https://gemnasium.com/sul-dlss/harvestdor-indexer.svg" alt="Dependency Status" />}[https://gemnasium.com/sul-dlss/harvestdor-indexer]
5
- {<img src="https://badge.fury.io/rb/harvestdor-indexer.svg" alt="Gem Version" />}[http://badge.fury.io/rb/harvestdor-indexer]
1
+ # Harvestdor::Indexer
2
+ [![Build Status](https://travis-ci.org/sul-dlss/harvestdor-indexer.png?branch=master)](https://travis-ci.org/sul-dlss/harvestdor-indexer) | [![Coverage Status](https://coveralls.io/repos/sul-dlss/harvestdor-indexer/badge.png?branch=master)](https://coveralls.io/r/sul-dlss/harvestdor-indexer) | [![Gem Version](https://badge.fury.io/rb/blacklight-harvestdor-indexer.png)](http://badge.fury.io/rb/blacklight-harvestdor-indexer) | [![Dependency Status](https://gemnasium.com/sul-dlss/harvestdor-indexer.svg)](https://gemnasium.com/sul-dlss/harvestdor-indexer)
3
+
6
4
 
7
5
  A Gem to harvest meta/data from DOR and the skeleton code to index it and write to Solr.
8
6
 
9
- == Installation
7
+ ## Installation
10
8
 
11
9
  Add this line to your application's Gemfile:
12
10
 
@@ -20,11 +18,11 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install harvestdor-indexer
22
20
 
23
- == Usage
21
+ ## Usage
24
22
 
25
23
  You must override the index method and provide configuration options. It is recommended to write a script to run it, too - example below.
26
24
 
27
- === Configuration / Set up
25
+ ### Configuration / Set up
28
26
 
29
27
  Create a yml config file for your collection going to a Solr index.
30
28
 
@@ -37,7 +35,7 @@ You will want to copy that file and change the following settings:
37
35
  * harvestdor log_dir, log_nam
38
36
 
39
37
 
40
- ==== Whitelist
38
+ #### Whitelist
41
39
 
42
40
  The whitelist is how you specify which objects to index. The whitelist can be
43
41
 
@@ -49,7 +47,7 @@ If a druid, per the object's identityMetadata at purl page, is for a
49
47
  * collection record: then we process all the item druids in that collection (as if they were included individually in the whitelist)
50
48
  * non-collection record: then we process the druid as an individual item
51
49
 
52
- === Override the Harvestdor::Indexer.index method
50
+ ### Override the Harvestdor::Indexer.index method
53
51
 
54
52
  In your code, override this method from the Harvestdor::Indexer class
55
53
 
@@ -70,7 +68,7 @@ In your code, override this method from the Harvestdor::Indexer class
70
68
  end
71
69
 
72
70
 
73
- === Run it
71
+ ### Run it
74
72
 
75
73
  (bundle install)
76
74
 
@@ -100,7 +98,7 @@ Then you run the script like so:
100
98
 
101
99
  Run from deployed instance, as that box is already set up to be able to talk to DOR Fetcher service and to SUL Solr indexes.
102
100
 
103
- == Contributing
101
+ ## Contributing
104
102
 
105
103
  * Fork it (https://help.github.com/articles/fork-a-repo/)
106
104
  * Create your feature branch (`git checkout -b my-new-feature`)
data/Rakefile CHANGED
@@ -40,9 +40,8 @@ begin
40
40
  doc_dest_dir = File.join(project_root, 'doc')
41
41
 
42
42
  YARD::Rake::YardocTask.new(:doc) do |yt|
43
- yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
44
- [File.join(project_root, 'README.rdoc')]
45
- yt.options = ['--output-dir', doc_dest_dir, '--readme', 'README.rdoc', '--title', 'Harvestdor Gem Documentation']
43
+ yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) + [File.join(project_root, 'README.md')]
44
+ yt.options = ['--output-dir', doc_dest_dir, '--readme', 'README.md', '--title', 'Harvestdor Gem Documentation']
46
45
  end
47
46
  rescue LoadError
48
47
  desc 'Generate YARD Documentation'
@@ -59,7 +59,9 @@ module Harvestdor
59
59
  # Return the items in this collection
60
60
  def items
61
61
  return [] unless collection?
62
- return to_enum(:items) unless block_given?
62
+
63
+ # return an enumerator, with an estimated size of the collection
64
+ return to_enum(:items) { items_druids.length } unless block_given?
63
65
 
64
66
  items_druids.each do |x|
65
67
  yield Harvestdor::Indexer::Resource.new(indexer, x)
@@ -1,6 +1,6 @@
1
1
  module Harvestdor
2
2
  class Indexer
3
3
  # this is the Ruby Gem version
4
- VERSION = '2.2.0'
4
+ VERSION = '2.3.0'
5
5
  end
6
6
  end
@@ -44,6 +44,11 @@ describe Harvestdor::Indexer::Resource do
44
44
  child = subject.items.first
45
45
  expect(child.druid).to eq 'oo000oo0001'
46
46
  end
47
+
48
+ it 'estimates the size of the enumerator without instantiating objects' do
49
+ expect(described_class).not_to receive(:new)
50
+ expect(subject.items.size).to eq 2
51
+ end
47
52
  end
48
53
  end
49
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harvestdor-indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naomi Dushay
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-10-30 00:00:00.000000000 Z
13
+ date: 2015-11-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
@@ -268,7 +268,7 @@ files:
268
268
  - ".yardopts"
269
269
  - Gemfile
270
270
  - LICENSE.txt
271
- - README.rdoc
271
+ - README.md
272
272
  - Rakefile
273
273
  - harvestdor-indexer.gemspec
274
274
  - lib/harvestdor-indexer.rb
@@ -308,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
308
308
  version: '0'
309
309
  requirements: []
310
310
  rubyforge_project:
311
- rubygems_version: 2.4.8
311
+ rubygems_version: 2.4.5.1
312
312
  signing_key:
313
313
  specification_version: 4
314
314
  summary: Harvest DOR object metadata and index it to Solr