blacklight_oai_provider 6.1.0 → 6.1.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: 6ceebec774a13c7b3e0651472ef6c78ef01e091cad8e5a2b7cfe4dee8597f883
4
- data.tar.gz: bea9de1be5db043c9094a66f3be592623a3ef5ed970579e406ccacae1c1246d6
3
+ metadata.gz: 6b8abebeaa16868fc1ad106d29bc74be140a2c3bcd1452ca77d80a305c54ff71
4
+ data.tar.gz: fa4142efe30c1183c79b4f5a96a74ed7b6c8fa4c13d9622b1f8aa3e644b9fceb
5
5
  SHA512:
6
- metadata.gz: aabaa271f67221254df440c532664dbba119e50031f5cf9dffaddbf31453483d354b783dbbd3291a991a8e939b8d5459541d73aeca210eaac28b53a56d49f5bb
7
- data.tar.gz: 4b5fa537fb35349a6cd5814d16726964bee90f22aeff513868287a50c97d9fda5be7b07343748f0380d478d2d318b8e4ba6580a7845881bbaf0a2a2b58e49d8e
6
+ metadata.gz: 951af42d0f21f58fd0af44277b59c640e6de517da49fc4eaa2e06ada02627be0c8465aa080b6924f8ef13062795718bff8f9d90bfd16e736cfbf4205d26ba36b
7
+ data.tar.gz: 24bbe4772cd6cead1db8519c9719b294b1439ffe314e472e82455cfd39135a5c5cdf53c8746d7b59d99d014015ee37a40026903e1ad5928540ab233ecd08a0df
@@ -0,0 +1,66 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: CI
9
+
10
+ on: push
11
+
12
+ jobs:
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: 2.6
21
+ - name: Install dependencies
22
+ run: bundle install
23
+ env:
24
+ RAILS_VERSION: 5.2.4.4
25
+ - name: Run linter
26
+ run: bundle exec rubocop
27
+ test_rails5_2:
28
+ runs-on: ubuntu-latest
29
+ strategy:
30
+ matrix:
31
+ ruby: [2.6]
32
+ steps:
33
+ - uses: actions/checkout@v2
34
+ - name: Set up Ruby
35
+ uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+ - name: Install dependencies
39
+ run: bundle install
40
+ env:
41
+ RAILS_VERSION: 5.2.4.4
42
+ - name: Run tests
43
+ run: bundle exec rake ci
44
+ env:
45
+ RAILS_VERSION: 5.2.4.4
46
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
47
+ test_rails5_1:
48
+ runs-on: ubuntu-latest
49
+ strategy:
50
+ matrix:
51
+ ruby: [2.5]
52
+ steps:
53
+ - uses: actions/checkout@v2
54
+ - name: Set up Ruby
55
+ uses: ruby/setup-ruby@v1
56
+ with:
57
+ ruby-version: ${{ matrix.ruby }}
58
+ - name: Install dependencies
59
+ run: bundle install
60
+ env:
61
+ RAILS_VERSION: 5.1.7
62
+ - name: Run tests
63
+ run: bundle exec rake ci
64
+ env:
65
+ RAILS_VERSION: 5.1.7
66
+ ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
data/.rubocop.yml CHANGED
@@ -50,3 +50,6 @@ Style/Documentation:
50
50
  Lint/UnusedMethodArgument:
51
51
  Exclude:
52
52
  - 'lib/blacklight_oai_provider/set.rb'
53
+
54
+ RSpec/NestedGroups:
55
+ Enabled: false
data/VERSION CHANGED
@@ -1 +1 @@
1
- 6.1.0
1
+ 6.1.1
@@ -41,7 +41,8 @@ module BlacklightOaiProvider
41
41
  end
42
42
  response.documents
43
43
  else
44
- @controller.fetch(selector).first.documents.first
44
+ query = @controller.search_builder.where(document_model.unique_key => selector).query
45
+ @controller.repository.search(query).documents.first
45
46
  end
46
47
  end
47
48
 
@@ -1932,6 +1932,7 @@
1932
1932
  - Israel
1933
1933
  title_si: bituaḥ u-viṭaḥon sotsyali
1934
1934
  id: '2005553155'
1935
+ visibility_si: "open"
1935
1936
  author_si: "\U0010FFFF Bituaḥ uviṭaḥon sotsyali"
1936
1937
  title_addl_tsim:
1937
1938
  - "[Bituaḥ u-viṭaḥon sotsyali]."
@@ -2064,6 +2065,7 @@
2064
2065
  - '9780743297790'
2065
2066
  - 0743297792
2066
2067
  id: '2007020969'
2068
+ visibility_si: "restricted"
2067
2069
  author_si: Hearth Amy Hill 1958 Strong Medicine speaks a Native American elder
2068
2070
  has her say an oral history
2069
2071
  title_addl_tsim:
@@ -29,7 +29,7 @@ describe CatalogController do
29
29
  )
30
30
  end
31
31
 
32
- it 'return corrext document configuration' do
32
+ it 'return correct document configuration' do
33
33
  expect(controller.oai_config[:document][:limit]).to be 25
34
34
  end
35
35
  end
@@ -51,8 +51,30 @@ RSpec.describe BlacklightOaiProvider::SolrDocumentWrapper do
51
51
  end
52
52
 
53
53
  context 'when selector is an individual record' do
54
- it 'returns a single record' do
55
- expect(wrapper.find('2005553155')).to be_a SolrDocument
54
+ class VisibilityAwareSearchBuilder < Blacklight::SearchBuilder
55
+ include Blacklight::Solr::SearchBuilderBehavior
56
+ self.default_processor_chain += [:only_visible]
57
+
58
+ def only_visible(solr_parameters)
59
+ solr_parameters[:fq] ||= []
60
+ solr_parameters[:fq] << 'visibility_si:"open"'
61
+ end
62
+ end
63
+
64
+ before do
65
+ allow(controller).to receive(:search_builder_class).and_return(VisibilityAwareSearchBuilder)
66
+ end
67
+
68
+ context 'with a restricted work' do
69
+ it 'returns nothing' do
70
+ expect(wrapper.find('2007020969')).to be_nil
71
+ end
72
+ end
73
+
74
+ context 'with a public work' do
75
+ it 'returns a single record' do
76
+ expect(wrapper.find('2005553155')).to be_a SolrDocument
77
+ end
56
78
  end
57
79
  end
58
80
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_oai_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-01-14 00:00:00.000000000 Z
12
+ date: 2021-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: blacklight
@@ -173,11 +173,11 @@ executables: []
173
173
  extensions: []
174
174
  extra_rdoc_files: []
175
175
  files:
176
+ - ".github/workflows/ci.yml"
176
177
  - ".gitignore"
177
178
  - ".rubocop.yml"
178
179
  - ".rubocop_todo.yml"
179
180
  - ".solr_wrapper"
180
- - ".travis.yml"
181
181
  - Gemfile
182
182
  - MIT-LICENSE
183
183
  - README.md
data/.travis.yml DELETED
@@ -1,26 +0,0 @@
1
- dist: bionic
2
- language: ruby
3
- addons:
4
- chrome: stable
5
- before_install:
6
- - google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 http://localhost &
7
-
8
- notifications:
9
- email: false
10
-
11
- matrix:
12
- include:
13
- - rvm: 2.6.5
14
- env: "RAILS_VERSION=5.2.3"
15
- - rvm: 2.5.7
16
- env: "RAILS_VERSION=5.1.7"
17
-
18
- notifications:
19
- irc: "irc.freenode.org#blacklight"
20
- email:
21
- - blacklight-commits@googlegroups.com
22
-
23
- global_env:
24
- - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
25
-
26
- jdk: oraclejdk9