geo_combine 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: a403eec66c0f81cd06bed4033f411ed137276277e6f9a6eb0a672c64428dcca0
4
- data.tar.gz: 7c6e8a61d3d8783a633edac40c57c435a4b6b3d9bd17ff1ae272e794fb6c2b56
3
+ metadata.gz: '0439618d4248a21c1f4efe91e863d01ad9b97f0798b7f855b60c15eab7457bbf'
4
+ data.tar.gz: a01ec4dc01b9c6d3dd39e34c178f2271b83d8c51ecf16226e8595a36ddbf37ea
5
5
  SHA512:
6
- metadata.gz: b995db35d3452c377d93a9384018e54c01730b76462e5109d3a4ab3e7e24ddcbf3a8fa1b7703b2e571832a054d8a43459a34b18df9b5af418e87107c8509a873
7
- data.tar.gz: fc129701c6e2fb138e9f43aab3b2b6e84dc68696813cbb1fb5c7ede89f364c88b8d5717a3e477fc030dfd2ee588a335df0274bf4005f1434c14a841d0f92e0de
6
+ metadata.gz: 4c7c77f1cf1b60e7438f144d97a1af16126cdc1c9567ae2006cdcaa26c47fc0d5af8672e6368b5b139789b8f44f55cbadc1bd1f220b84b4a36c4bfc78dba3a65
7
+ data.tar.gz: d33c6c00ed6b39a6c2a8238ad9e14304bb59e450a031b8b8836635bb71d4a2deed3b8b0de68ca10c6e0ae9e9013f67acab42e765534475e2040af76f65a7a1ad
data/README.md CHANGED
@@ -105,12 +105,16 @@ $ SOLR_COMMIT_WITHIN=100 bundle exec rake geocombine:index
105
105
 
106
106
  GeoCombine provides a Harvester class and rake task to harvest and index content from GeoBlacklight sites (or any site that follows the Blacklight API format). Given that the configurations can change from consumer to consumer and site to site, the class provides a relatively simple configuration API. This can be configured in an initializer, a wrapping rake task, or any other ruby context where the rake task our class would be invoked.
107
107
 
108
+ ```sh
109
+ bundle exec rake geocombine:geoblacklight_harvester:index[YOUR_CONFIGURED_SITE_KEY]
110
+ ```
111
+
108
112
  #### Harvester configuration
109
113
 
110
114
  Only the sites themselves are required to be configured but there are various configuration options that can (optionally) be supplied to modify the harvester's behavior.
111
115
 
112
116
  ```ruby
113
- GeoCombine::GeoBlacklightIndexer.configure do
117
+ GeoCombine::GeoBlacklightHarvester.configure do
114
118
  {
115
119
  commit_within: '10000',
116
120
  crawl_delay: 1, # All sites
@@ -146,6 +146,7 @@ module GeoCombine
146
146
 
147
147
  url = response.dig('links', 'next')
148
148
  break unless url
149
+ url = "#{url}&format=json"
149
150
  self.page += 1
150
151
  puts "Fetching page #{page} @ #{url}" if GeoCombine::GeoBlacklightHarvester.config[:debug]
151
152
  begin
@@ -1,3 +1,3 @@
1
1
  module GeoCombine
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
@@ -64,10 +64,10 @@ namespace :geocombine do
64
64
 
65
65
  namespace :geoblacklight_harvester do
66
66
  desc 'Harvest documents from a configured GeoBlacklight instance'
67
- task :index, [:site] do |_t, args|
67
+ task :index, [:site] => [:environment] do |_t, args|
68
68
  raise ArgumentError, 'A site argument is required' unless args.site
69
69
 
70
- GeoCombine::GeoBlacklightHarvester.new(args.site).index
70
+ GeoCombine::GeoBlacklightHarvester.new(args.site.to_sym).index
71
71
  end
72
72
  end
73
73
  end
@@ -148,7 +148,7 @@ RSpec.describe GeoCombine::GeoBlacklightHarvester do
148
148
  before do
149
149
  allow(RSolr).to receive(:connect).and_return(stub_solr_connection)
150
150
  expect(Net::HTTP).to receive(:get).with(
151
- URI('https://example.com?f%5Bdct_provenance_s%5D%5B%5D=INSTITUTION&format=json&per_page=100&page=2')
151
+ URI('https://example.com/catalog.json?f%5Bdct_provenance_s%5D%5B%5D=INSTITUTION&per_page=100&page=2&format=json')
152
152
  ).and_return(second_results_response.to_json)
153
153
  end
154
154
 
@@ -157,7 +157,7 @@ RSpec.describe GeoCombine::GeoBlacklightHarvester do
157
157
  { 'links' => { 'self' => 'https://example.com/catalog/abc-123' } },
158
158
  { 'links' => { 'self' => 'https://example.com/catalog/abc-321' } }
159
159
  ],
160
- 'links' => { 'next' => 'https://example.com?f%5Bdct_provenance_s%5D%5B%5D=INSTITUTION&format=json&per_page=100&page=2' }
160
+ 'links' => { 'next' => 'https://example.com/catalog.json?f%5Bdct_provenance_s%5D%5B%5D=INSTITUTION&per_page=100&page=2' }
161
161
  }
162
162
  end
163
163
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_combine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -245,7 +245,7 @@ homepage: ''
245
245
  licenses:
246
246
  - Apache
247
247
  metadata: {}
248
- post_install_message:
248
+ post_install_message:
249
249
  rdoc_options: []
250
250
  require_paths:
251
251
  - lib
@@ -260,8 +260,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  - !ruby/object:Gem::Version
261
261
  version: '0'
262
262
  requirements: []
263
- rubygems_version: 3.1.2
264
- signing_key:
263
+ rubygems_version: 3.0.3
264
+ signing_key:
265
265
  specification_version: 4
266
266
  summary: A Ruby toolkit for managing geospatial metadata
267
267
  test_files: