Skip to content

Commit

Permalink
Merge 3690872 into 35a698e
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmcbride committed Sep 1, 2020
2 parents 35a698e + 3690872 commit 75f9850
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -43,6 +43,7 @@ env:
# should be compatible across patch versions (only bug fixes are released in patch versions).
matrix:
- "RAILS_VERSION=5.1.7"
- "RAILS_VERSION=5.2"

services:
- redis
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -32,7 +32,7 @@ Jump in: [![Slack Status](http://slack.samvera.org/badge.svg)](http://slack.samv
# Overview
NewspaperWorks is a gem (Rails "engine") for [Hyrax](https://hyrax.samvera.org/) -based digital repository applications to support ingest, management, and display of digitized newspaper content.

NewspaperWorks is not a stand-alone application. It is designed to be integrated into a new or existing Hyrax (v2.5-v2.7) application, providing content models, ingest workflows, and feature-rich UX for newspaper repository use-cases.
NewspaperWorks is not a stand-alone application. It is designed to be integrated into a new or existing Hyrax (v2.5-v2.8) application, providing content models, ingest workflows, and feature-rich UX for newspaper repository use-cases.

NewspaperWorks supports:
* models for Title, Issue, Page, and Article
Expand All @@ -53,9 +53,9 @@ A set of helpful documents to help you learn more and deploy NewspaperWorks can
## Requirements

* [Ruby](https://rubyonrails.org/) >=2.4
* [Rails](https://rubyonrails.org/) ~>5.1.7
* [Rails](https://rubyonrails.org/) ~>5.0
* [Bundler](http://bundler.io/)
* [Hyrax](https://github.com/samvera/hyrax) v2.5-v2.7
* [Hyrax](https://github.com/samvera/hyrax) v2.5-v2.8
- ..._and various [Samvera dependencies](https://github.com/samvera/hyrax#getting-started) that entails_.
* A Hyrax-based Rails application

Expand Down
Expand Up @@ -21,12 +21,10 @@ def index_pop(object, solr_doc)
#
# @param solr_doc [Hash] the hash of field data to be pushed to Solr
def add_geodata_fields(solr_doc)
%w[city county state country].each do |place|
solr_doc["place_of_publication_#{place}_sim"] ||= []
%w[city county state country label coords].each do |v|
solr_doc["place_of_publication_#{v}_sim"] ||= []
end
solr_doc['place_of_publication_label_tesim'] ||= []
solr_doc['place_of_publication_label_sim'] ||= []
solr_doc['place_of_publication_llsim'] ||= []
end

# adds geographic data to solr_doc Hash, with fields for
Expand All @@ -48,7 +46,7 @@ def index_pop_geodata(geodata, solr_doc)
solr_doc['place_of_publication_label_sim'] << display_name
return unless geodata['lat'] && geodata['lng']
# TODO: this should use a Solr location_rpt field type
solr_doc['place_of_publication_llsim'] << "#{geodata['lat']},#{geodata['lng']}"
solr_doc['place_of_publication_coords_sim'] << "#{geodata['lat']},#{geodata['lng']}"
end

# fetch data from GeoNames API
Expand Down
Expand Up @@ -116,7 +116,7 @@ def index_parent_facets(parent, solr_doc)
fields = %w[language_sim place_of_publication_label_sim
place_of_publication_city_sim place_of_publication_county_sim
place_of_publication_state_sim place_of_publication_country_sim
place_of_publication_llsim place_of_publication_label_tesim]
place_of_publication_coords_sim place_of_publication_label_tesim]
fields.each do |field|
solr_doc[field] ||= parent_doc[field]
end
Expand Down
4 changes: 2 additions & 2 deletions newspaper_works.gemspec
Expand Up @@ -24,9 +24,9 @@ SUMMARY
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.add_dependency 'blacklight_iiif_search', '~> 1.0'
spec.add_dependency 'blacklight_advanced_search', '6.4.1'
spec.add_dependency 'hyrax', '>= 2.5', '< 2.8'
spec.add_dependency 'hyrax', '~> 2.8.0'
spec.add_dependency 'nokogiri'
spec.add_dependency 'rails', '~> 5.1.7'
spec.add_dependency 'rails', '~> 5.0'
spec.add_dependency 'rdf-vocab', '< 3.1.5'
spec.add_dependency 'sass-rails', '~> 5.0'

Expand Down
Expand Up @@ -13,12 +13,12 @@
let(:solr_doc) { {} }
before do
allow(test_indexer).to receive(:get_geodata).and_return(geodata)
ntitle.place_of_publication = pop
ntitle.place_of_publication = [pop]
test_indexer.index_pop(ntitle, solr_doc)
end
it 'sets the geodata fields correctly' do
expect(solr_doc['place_of_publication_state_sim'].first).not_to be_falsey
expect(solr_doc['place_of_publication_llsim'].first).not_to be_falsey
expect(solr_doc['place_of_publication_coords_sim'].first).not_to be_falsey
end
end

Expand All @@ -39,7 +39,7 @@
end
it 'parses the geodata correctly' do
expect(solr_doc['place_of_publication_city_sim']).to include('Salem')
expect(solr_doc['place_of_publication_llsim']).to include('42.51954,-70.89672')
expect(solr_doc['place_of_publication_coords_sim']).to include('42.51954,-70.89672')
end
end

Expand Down
Expand Up @@ -7,7 +7,7 @@
NewspaperArticle.new(
id: 'foo1234',
title: ['Whatever'],
place_of_publication: pop
place_of_publication: [pop]
)
end
let(:indexer) { described_class.new(article) }
Expand Down

0 comments on commit 75f9850

Please sign in to comment.