harvestdor-indexer 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -7
- data/{README.rdoc → README.md} +10 -12
- data/Rakefile +2 -3
- data/lib/harvestdor/indexer/resource.rb +3 -1
- data/lib/harvestdor/indexer/version.rb +1 -1
- data/spec/unit/harvestdor-indexer-resource_spec.rb +5 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96e29c5f341999505f85ed425337dd44ca1046b
|
4
|
+
data.tar.gz: 08fb83487024f6aede8af03146a5f1bc37cdb963
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e534e9836695329596135b256524bfcb1a774add00c81e4e6d6a17f4c08f127df671f43066616265d237fddeaf147b9992a9822cf8f166c03b255222fb6ece46
|
7
|
+
data.tar.gz: 4365f67d19849eb939c5abf91d77870ad5cc01b2fea6012b729ee9eb09b6a44ef94dc1ae04cebff9badeb1004a1f27d5e302d9e9d70d6a296c1cfb4b45ce508f
|
data/.travis.yml
CHANGED
@@ -2,14 +2,10 @@ language: ruby
|
|
2
2
|
sudo: false
|
3
3
|
script: rake
|
4
4
|
rvm:
|
5
|
-
- 2.2.
|
6
|
-
|
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
|
-
-
|
11
|
+
- cabeer@stanford.edu
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,12 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
+
[](https://travis-ci.org/sul-dlss/harvestdor-indexer) | [](https://coveralls.io/r/sul-dlss/harvestdor-indexer) | [](http://badge.fury.io/rb/blacklight-harvestdor-indexer) | [](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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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)
|
@@ -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.
|
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
|
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.
|
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.
|
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
|