hydra-core 11.0.0.rc1 → 11.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/hydra/catalog.rb +0 -5
- data/app/controllers/concerns/hydra/controller/download_behavior.rb +1 -5
- data/hydra-core.gemspec +5 -5
- data/lib/generators/hydra/head_generator.rb +10 -2
- data/lib/hydra-head/version.rb +1 -1
- data/spec/models/user_spec.rb +1 -1
- data/spec/search_builders/search_builder_spec.rb +10 -9
- data/spec/spec_helper.rb +14 -8
- metadata +25 -28
- data/spec/factories.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b236ff206441cb6307af47cd301f992b280c94b4cfed89a9fafc2c93bbfb5abb
|
4
|
+
data.tar.gz: e18f193c12ac996b90e02d48d587db90ad4423e5e57bae4c8eaad793c9c71e65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f4c357ad8c2c7fe8ce9ff4d64fe76a3c977cff8ed75e4dde3d3a9ee5d71bbf39fe88cc63818c2bdf3b4f2a42a580edd37511d0c3f6dff381ad8387f0ed4b6d
|
7
|
+
data.tar.gz: f495df249c440f139281199eb08dc1c0adfadc380159afe3ac11127fc2319302c2035e8ff8f6c1e1d5b0a9642f9b4a04df42db80f92a6fdff9b971a139a41c38
|
@@ -3,11 +3,6 @@ module Hydra::Catalog
|
|
3
3
|
include Blacklight::Catalog
|
4
4
|
include Blacklight::AccessControls::Catalog
|
5
5
|
|
6
|
-
# This will work for BL 6, but will need to move to SearchService in BL 7
|
7
|
-
def search_builder
|
8
|
-
Hydra::AccessControls::SearchBuilder.new(self, ability: current_ability)
|
9
|
-
end
|
10
|
-
|
11
6
|
# Action-specific enforcement
|
12
7
|
# Controller "before" filter for enforcing access controls on show actions
|
13
8
|
# @param [Hash] opts (optional, not currently used)
|
@@ -125,11 +125,7 @@ module Hydra
|
|
125
125
|
unless response.headers["Last-Modified"] || response.headers["ETag"]
|
126
126
|
Rails.logger.warn("Response may be buffered instead of streaming, best to set a Last-Modified or ETag header")
|
127
127
|
end
|
128
|
-
|
129
|
-
response.stream.write in_buff
|
130
|
-
end
|
131
|
-
ensure
|
132
|
-
response.stream.close
|
128
|
+
self.response_body = iostream
|
133
129
|
end
|
134
130
|
|
135
131
|
def default_file
|
data/hydra-core.gemspec
CHANGED
@@ -4,7 +4,7 @@ version = File.read(File.expand_path("../../HYDRA_VERSION", __FILE__)).strip
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield, Justin Coyne & many more. See https://github.com/projecthydra/hydra-head/contributors"]
|
6
6
|
gem.email = ["hydra-tech@googlegroups.com"]
|
7
|
-
gem.homepage = "
|
7
|
+
gem.homepage = "https://github.com/samvera/hydra-head/tree/master/hydra-core"
|
8
8
|
gem.summary = %q{Hydra-Head Rails Engine (requires Rails3) }
|
9
9
|
gem.description = %q{Hydra-Head is a Rails Engine containing the core code for a Hydra application. The full hydra stack includes: Blacklight, Fedora, Solr, active-fedora, solrizer, and om}
|
10
10
|
|
@@ -16,12 +16,12 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = version
|
17
17
|
gem.license = "APACHE2"
|
18
18
|
|
19
|
-
gem.required_ruby_version = '>=
|
19
|
+
gem.required_ruby_version = '>= 2.4'
|
20
20
|
|
21
|
-
gem.add_dependency "railties", '>= 4.0.0', '< 6'
|
22
21
|
gem.add_dependency 'hydra-access-controls', version
|
22
|
+
gem.add_dependency "railties", '>= 4.0.0', '< 6'
|
23
23
|
|
24
|
-
gem.add_development_dependency '
|
24
|
+
gem.add_development_dependency 'rails-controller-testing', '~> 1'
|
25
25
|
gem.add_development_dependency 'rspec-rails', '~> 3.1'
|
26
|
-
gem.add_development_dependency '
|
26
|
+
gem.add_development_dependency 'sqlite3', '~> 1.3'
|
27
27
|
end
|
@@ -49,6 +49,14 @@ module Hydra
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
# Add Hydra to the SearchBuilder
|
53
|
+
def inject_hydra_search_builder_behavior
|
54
|
+
insert_into_file "app/models/search_builder.rb", after: "include Blacklight::Solr::SearchBuilderBehavior\n" do
|
55
|
+
" # Add a filter query to restrict the search to documents the current user has access to\n" \
|
56
|
+
" include Hydra::AccessControlsEnforcement\n"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
52
60
|
# Copy all files in templates/config directory to host config
|
53
61
|
def create_configuration_files
|
54
62
|
|
@@ -71,7 +79,7 @@ module Hydra
|
|
71
79
|
def create_conneg_configuration
|
72
80
|
file_path = "config/initializers/mime_types.rb"
|
73
81
|
append_to_file file_path do
|
74
|
-
"Mime::Type.register \"application/n-triples\", :nt\n" +
|
82
|
+
"Mime::Type.register \"application/n-triples\", :nt\n" +
|
75
83
|
"Mime::Type.register \"application/ld+json\", :jsonld\n" +
|
76
84
|
"Mime::Type.register \"text/turtle\", :ttl"
|
77
85
|
end
|
@@ -81,7 +89,7 @@ module Hydra
|
|
81
89
|
file_path = "app/models/solr_document.rb"
|
82
90
|
if File.exists?(file_path)
|
83
91
|
inject_into_file file_path, :before => /end\Z/ do
|
84
|
-
"\n # Do content negotiation for AF models. \n" +
|
92
|
+
"\n # Do content negotiation for AF models. \n" +
|
85
93
|
"\n use_extension( Hydra::ContentNegotiation )\n"
|
86
94
|
end
|
87
95
|
end
|
data/lib/hydra-head/version.rb
CHANGED
data/spec/models/user_spec.rb
CHANGED
@@ -1,22 +1,23 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
let(:
|
5
|
-
let(:context) { double('context'
|
3
|
+
describe SearchBuilder do
|
4
|
+
let(:processor_chain) { [:add_access_controls_to_solr_params] }
|
5
|
+
let(:context) { double('context') }
|
6
6
|
let(:user) { double('user', user_key: 'joe') }
|
7
|
-
let(:current_ability)
|
8
|
-
double('ability', user_groups: [], current_user: user)
|
9
|
-
end
|
10
|
-
|
7
|
+
let(:current_ability) { double('ability', user_groups: [], current_user: user) }
|
11
8
|
let(:search_builder) { described_class }
|
12
9
|
|
13
10
|
subject do
|
14
|
-
search_builder.new(
|
11
|
+
search_builder.new(processor_chain, context)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "extends classes with the necessary Hydra modules" do
|
15
|
+
expect(described_class.included_modules).to include(Hydra::AccessControlsEnforcement)
|
15
16
|
end
|
16
17
|
|
17
18
|
context "when a query is generated" do
|
18
19
|
it "triggers add_access_controls_to_solr_params" do
|
19
|
-
expect(subject).to receive(:
|
20
|
+
expect(subject).to receive(:add_access_controls_to_solr_params)
|
20
21
|
subject.query
|
21
22
|
end
|
22
23
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
ENV['RAILS_ENV'] ||= 'test'
|
2
4
|
|
3
5
|
require 'engine_cart'
|
4
6
|
path = File.expand_path(File.join('..', '..', '..', '.internal_test_app'), __FILE__)
|
@@ -7,15 +9,19 @@ EngineCart.load_application! path
|
|
7
9
|
require 'bundler/setup'
|
8
10
|
require 'rspec/rails'
|
9
11
|
require 'hydra-core'
|
10
|
-
require "factory_bot"
|
11
|
-
require "factories"
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
require 'simplecov-rcov'
|
13
|
+
require 'simplecov'
|
14
|
+
require 'coveralls'
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
SimpleCov.root(File.expand_path('../..', __dir__))
|
17
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
18
|
+
[
|
19
|
+
SimpleCov::Formatter::HTMLFormatter,
|
20
|
+
Coveralls::SimpleCov::Formatter
|
21
|
+
]
|
22
|
+
)
|
23
|
+
SimpleCov.start('rails') do
|
24
|
+
add_filter %r{lib/generators/.*\.rb}
|
19
25
|
end
|
20
26
|
|
21
27
|
ActiveFedora::Base.logger = Logger.new(STDOUT)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.0.0.
|
4
|
+
version: 11.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield,
|
@@ -9,8 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: hydra-access-controls
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 11.0.0.rc2
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 11.0.0.rc2
|
14
28
|
- !ruby/object:Gem::Dependency
|
15
29
|
name: railties
|
16
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -32,33 +46,19 @@ dependencies:
|
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '6'
|
34
48
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
36
|
-
requirement: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 11.0.0.rc1
|
41
|
-
type: :runtime
|
42
|
-
prerelease: false
|
43
|
-
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 11.0.0.rc1
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: sqlite3
|
49
|
+
name: rails-controller-testing
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1
|
54
|
+
version: '1'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1
|
61
|
+
version: '1'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec-rails
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,19 +74,19 @@ dependencies:
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '3.1'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
77
|
+
name: sqlite3
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '1.3'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '1.3'
|
90
90
|
description: 'Hydra-Head is a Rails Engine containing the core code for a Hydra application.
|
91
91
|
The full hydra stack includes: Blacklight, Fedora, Solr, active-fedora, solrizer,
|
92
92
|
and om'
|
@@ -131,7 +131,6 @@ files:
|
|
131
131
|
- spec/controllers/catalog_controller_spec.rb
|
132
132
|
- spec/controllers/downloads_controller_spec.rb
|
133
133
|
- spec/controllers/ip_based_ability_spec.rb
|
134
|
-
- spec/factories.rb
|
135
134
|
- spec/helpers/blacklight_helper_spec.rb
|
136
135
|
- spec/models/content_negotiation/replacing_graph_finder_spec.rb
|
137
136
|
- spec/models/solr_document_spec.rb
|
@@ -146,7 +145,7 @@ files:
|
|
146
145
|
- spec/support/matchers/solr_matchers.rb
|
147
146
|
- spec/unit/hydra-head-engine_spec.rb
|
148
147
|
- spec/unit/hydra-head_spec.rb
|
149
|
-
homepage:
|
148
|
+
homepage: https://github.com/samvera/hydra-head/tree/master/hydra-core
|
150
149
|
licenses:
|
151
150
|
- APACHE2
|
152
151
|
metadata: {}
|
@@ -158,15 +157,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
157
|
requirements:
|
159
158
|
- - ">="
|
160
159
|
- !ruby/object:Gem::Version
|
161
|
-
version:
|
160
|
+
version: '2.4'
|
162
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
162
|
requirements:
|
164
163
|
- - ">"
|
165
164
|
- !ruby/object:Gem::Version
|
166
165
|
version: 1.3.1
|
167
166
|
requirements: []
|
168
|
-
|
169
|
-
rubygems_version: 2.7.1
|
167
|
+
rubygems_version: 3.0.4
|
170
168
|
signing_key:
|
171
169
|
specification_version: 4
|
172
170
|
summary: Hydra-Head Rails Engine (requires Rails3)
|
@@ -175,7 +173,6 @@ test_files:
|
|
175
173
|
- spec/controllers/catalog_controller_spec.rb
|
176
174
|
- spec/controllers/downloads_controller_spec.rb
|
177
175
|
- spec/controllers/ip_based_ability_spec.rb
|
178
|
-
- spec/factories.rb
|
179
176
|
- spec/helpers/blacklight_helper_spec.rb
|
180
177
|
- spec/models/content_negotiation/replacing_graph_finder_spec.rb
|
181
178
|
- spec/models/solr_document_spec.rb
|