hydra-collections 2.0.5 → 3.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitmodules +0 -4
- data/.rspec +1 -0
- data/Gemfile +9 -0
- data/README.md +3 -3
- data/Rakefile +8 -8
- data/{lib → app/controllers/concerns}/hydra/collections/selects_collections.rb +3 -8
- data/app/controllers/concerns/hydra/collections_controller_behavior.rb +19 -20
- data/app/helpers/collections_search_helper.rb +2 -1
- data/app/models/concerns/hydra/collection.rb +80 -16
- data/app/views/collections/_search_form.html.erb +0 -16
- data/hydra-collections.gemspec +4 -4
- data/lib/hydra/collections/accepts_batches.rb +5 -5
- data/lib/hydra/collections/collectible.rb +15 -8
- data/lib/hydra/collections/solr_document_behavior.rb +0 -15
- data/lib/hydra/collections/version.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +5 -19
- data/spec/controllers/collections_controller_spec.rb +125 -154
- data/spec/controllers/other_collections_controller_spec.rb +13 -15
- data/spec/controllers/selects_collections_spec.rb +39 -48
- data/spec/factories.rb +0 -14
- data/spec/factories/users.rb +0 -14
- data/spec/helpers/collections_helper_spec.rb +14 -16
- data/spec/helpers/collections_search_helper_spec.rb +4 -2
- data/spec/lib/collectible_spec.rb +7 -7
- data/spec/models/collection_spec.rb +40 -42
- data/spec/spec_helper.rb +12 -1
- data/spec/{support → test_app_templates}/app/models/sample.rb +0 -0
- data/spec/{support → test_app_templates}/app/models/solr_document.rb +0 -0
- data/spec/{support → test_app_templates}/app/views/catalog/_document_header.html.erb +0 -0
- data/spec/{support → test_app_templates}/app/views/catalog/_index_collection.html.erb +0 -0
- data/spec/{support → test_app_templates}/app/views/catalog/_sort_and_per_page.html.erb +0 -0
- data/spec/{support → test_app_templates}/db/migrate/20111101221803_create_searches.rb +0 -0
- data/spec/{support → test_app_templates}/lib/generators/test_app_generator.rb +10 -2
- data/spec/{support → test_app_templates}/lib/tasks/rspec.rake +0 -0
- data/tasks/hydra-collections-dev.rake +16 -56
- metadata +33 -36
- data/app/models/datastreams/hydra/collection_rdf_datastream.rb +0 -58
- data/spec/factories/.gitkeep +0 -0
data/spec/spec_helper.rb
CHANGED
@@ -9,18 +9,29 @@ require 'hydra-collections'
|
|
9
9
|
FactoryGirl.definition_file_paths = [File.expand_path("../factories", __FILE__)]
|
10
10
|
FactoryGirl.find_definitions
|
11
11
|
|
12
|
+
# HttpLogger.logger = Logger.new(STDOUT)
|
13
|
+
# HttpLogger.ignore = [/localhost:8983\/solr/]
|
14
|
+
# HttpLogger.colorize = false
|
15
|
+
# # Patch for https://github.com/railsware/http_logger/issues/13
|
16
|
+
# HttpLogger::HTTP_METHODS_WITH_BODY = Set.new(%w(POST PUT GET PATCH))
|
17
|
+
|
12
18
|
module EngineRoutes
|
13
19
|
def self.included(base)
|
14
20
|
base.routes { Hydra::Collections::Engine.routes }
|
15
21
|
end
|
16
22
|
end
|
17
23
|
|
24
|
+
require 'active_fedora/cleaner'
|
18
25
|
RSpec.configure do |config|
|
19
26
|
config.use_transactional_fixtures = true
|
20
27
|
config.include Devise::TestHelpers, :type => :controller
|
21
|
-
config.before(:each, :
|
28
|
+
config.before(:each, type: "controller") { @routes = Hydra::Collections::Engine.routes }
|
22
29
|
config.include EngineRoutes, :type => :controller
|
23
30
|
config.infer_spec_type_from_file_location!
|
31
|
+
# Stub out test stuff.
|
32
|
+
config.before(:each) do
|
33
|
+
ActiveFedora::Cleaner.clean!
|
34
|
+
end
|
24
35
|
end
|
25
36
|
|
26
37
|
module FactoryGirl
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,14 @@
|
|
1
1
|
require 'rails/generators'
|
2
2
|
|
3
3
|
class TestAppGenerator < Rails::Generators::Base
|
4
|
-
source_root File.expand_path("../../../../
|
4
|
+
source_root File.expand_path("../../../../test_app_templates", __FILE__)
|
5
|
+
|
6
|
+
def update_gemfile
|
7
|
+
append_to_file "Gemfile" do
|
8
|
+
"\n gem 'factory_girl_rails'"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
5
12
|
|
6
13
|
def run_blacklight_generator
|
7
14
|
say_status("warning", "GENERATING BL", :yellow)
|
@@ -33,7 +40,7 @@ class TestAppGenerator < Rails::Generators::Base
|
|
33
40
|
|
34
41
|
def delete_generated_noise
|
35
42
|
remove_file("public/index.html")
|
36
|
-
remove_file("
|
43
|
+
remove_file("test/factories/users.rb")
|
37
44
|
end
|
38
45
|
|
39
46
|
def copy_view_overrides
|
@@ -74,3 +81,4 @@ class TestAppGenerator < Rails::Generators::Base
|
|
74
81
|
end
|
75
82
|
end
|
76
83
|
end
|
84
|
+
|
File without changes
|
@@ -1,11 +1,15 @@
|
|
1
1
|
require 'rspec/core'
|
2
2
|
require 'rspec/core/rake_task'
|
3
|
-
APP_ROOT="." # for jettywrapper
|
4
3
|
require 'jettywrapper'
|
5
|
-
|
4
|
+
require 'engine_cart/rake_task'
|
5
|
+
|
6
|
+
JETTY_ZIP_BASENAME = 'fedora-4/master'
|
7
|
+
Jettywrapper.url = "https://github.com/projecthydra/hydra-jetty/archive/#{JETTY_ZIP_BASENAME}.zip"
|
8
|
+
|
9
|
+
RSpec::Core::RakeTask.new(:spec)
|
6
10
|
|
7
11
|
desc 'Spin up hydra-jetty and run specs'
|
8
|
-
task :
|
12
|
+
task ci: ['engine_cart:clean', 'engine_cart:generate', 'jetty:clean'] do
|
9
13
|
puts 'running continuous integration'
|
10
14
|
jetty_params = Jettywrapper.load_config
|
11
15
|
error = Jettywrapper.wrap(jetty_params) do
|
@@ -14,61 +18,17 @@ task :ci => ['jetty:config'] do
|
|
14
18
|
raise "test failures: #{error}" if error
|
15
19
|
end
|
16
20
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
task :spec => [:generate] do |t|
|
21
|
-
focused_spec = ENV['SPEC'] ? " SPEC=#{File.join(GEM_ROOT, ENV['SPEC'])}" : ''
|
22
|
-
Bundler.with_clean_env do
|
23
|
-
within_test_app do
|
24
|
-
system "rake myspec#{focused_spec}"
|
25
|
-
abort "Error running hydra-collections" unless $?.success?
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
21
|
+
EXTRA_GEMS =<<EOF
|
22
|
+
gem 'active-fedora', '9.0.0.beta3'
|
23
|
+
gem 'hydra-head', github: 'projecthydra/hydra-head', branch: 'fedora-4'
|
29
24
|
|
30
|
-
|
31
|
-
task :generate do
|
32
|
-
unless File.exists?('spec/internal/Rakefile')
|
33
|
-
puts "Generating rails app"
|
34
|
-
`rails new spec/internal`
|
35
|
-
puts "Updating gemfile"
|
25
|
+
EOF
|
36
26
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
Bundler.with_clean_env do
|
43
|
-
within_test_app do
|
44
|
-
puts "Bundle install"
|
45
|
-
`bundle install`
|
46
|
-
puts "running test_app_generator"
|
47
|
-
system "rails generate test_app"
|
48
|
-
# These factories are autogenerated and conflict with our factories
|
49
|
-
system 'rm test/factories/users.rb'
|
50
|
-
puts "running migrations"
|
51
|
-
puts `rake db:migrate db:test:prepare`
|
52
|
-
end
|
27
|
+
namespace :engine_cart do
|
28
|
+
# we're adding some extra stuff into the gemfile beyond what engine_cart gives us by default
|
29
|
+
task :inject_gemfile_extras do
|
30
|
+
open(File.expand_path('Gemfile', EngineCart.destination), 'a') do |f|
|
31
|
+
f.write EXTRA_GEMS
|
53
32
|
end
|
54
33
|
end
|
55
|
-
puts "Done generating test app"
|
56
|
-
end
|
57
|
-
|
58
|
-
desc "Clean out the test rails app"
|
59
|
-
task :clean do
|
60
|
-
puts "Removing sample rails app"
|
61
|
-
`rm -rf spec/internal`
|
62
|
-
end
|
63
|
-
|
64
|
-
def within_test_app
|
65
|
-
FileUtils.cd('spec/internal')
|
66
|
-
yield
|
67
|
-
FileUtils.cd('../..')
|
68
|
-
end
|
69
|
-
|
70
|
-
namespace :meme do
|
71
|
-
desc "configure jetty to generate checksums"
|
72
|
-
task :config do
|
73
|
-
end
|
74
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-collections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -30,30 +30,30 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 8.0.0.alpha
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 8.0.0.alpha
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: deprecation
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: engine_cart
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".gitmodules"
|
92
|
+
- ".rspec"
|
92
93
|
- ".travis.yml"
|
93
94
|
- CONTRIBUTING.md
|
94
95
|
- Changelog.md
|
@@ -100,13 +101,13 @@ files:
|
|
100
101
|
- app/assets/javascripts/hydra_collections.js
|
101
102
|
- app/assets/stylesheets/hydra_collections.css.scss
|
102
103
|
- app/controllers/collections_controller.rb
|
104
|
+
- app/controllers/concerns/hydra/collections/selects_collections.rb
|
103
105
|
- app/controllers/concerns/hydra/collections_controller_behavior.rb
|
104
106
|
- app/helpers/batch_select_helper.rb
|
105
107
|
- app/helpers/collections_helper.rb
|
106
108
|
- app/helpers/collections_search_helper.rb
|
107
109
|
- app/models/collection.rb
|
108
110
|
- app/models/concerns/hydra/collection.rb
|
109
|
-
- app/models/datastreams/hydra/collection_rdf_datastream.rb
|
110
111
|
- app/models/solr_document.rb
|
111
112
|
- app/views/batch_select/_add_button.html.erb
|
112
113
|
- app/views/batch_select/_check_all.html.erb
|
@@ -137,7 +138,6 @@ files:
|
|
137
138
|
- lib/hydra/collections/accepts_batches.rb
|
138
139
|
- lib/hydra/collections/collectible.rb
|
139
140
|
- lib/hydra/collections/search_service.rb
|
140
|
-
- lib/hydra/collections/selects_collections.rb
|
141
141
|
- lib/hydra/collections/solr_document_behavior.rb
|
142
142
|
- lib/hydra/collections/version.rb
|
143
143
|
- solr_conf/conf/schema.xml
|
@@ -149,7 +149,6 @@ files:
|
|
149
149
|
- spec/controllers/other_collections_controller_spec.rb
|
150
150
|
- spec/controllers/selects_collections_spec.rb
|
151
151
|
- spec/factories.rb
|
152
|
-
- spec/factories/.gitkeep
|
153
152
|
- spec/factories/users.rb
|
154
153
|
- spec/helpers/collections_helper_spec.rb
|
155
154
|
- spec/helpers/collections_search_helper_spec.rb
|
@@ -157,17 +156,17 @@ files:
|
|
157
156
|
- spec/lib/search_service_spec.rb
|
158
157
|
- spec/models/collection_spec.rb
|
159
158
|
- spec/spec_helper.rb
|
160
|
-
- spec/
|
161
|
-
- spec/
|
162
|
-
- spec/
|
163
|
-
- spec/
|
164
|
-
- spec/
|
165
|
-
- spec/
|
166
|
-
- spec/
|
167
|
-
- spec/
|
159
|
+
- spec/test_app_templates/app/models/sample.rb
|
160
|
+
- spec/test_app_templates/app/models/solr_document.rb
|
161
|
+
- spec/test_app_templates/app/views/catalog/_document_header.html.erb
|
162
|
+
- spec/test_app_templates/app/views/catalog/_index_collection.html.erb
|
163
|
+
- spec/test_app_templates/app/views/catalog/_sort_and_per_page.html.erb
|
164
|
+
- spec/test_app_templates/db/migrate/20111101221803_create_searches.rb
|
165
|
+
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
166
|
+
- spec/test_app_templates/lib/tasks/rspec.rake
|
168
167
|
- tasks/hydra-collections-dev.rake
|
169
168
|
- tasks/jetty.rake
|
170
|
-
homepage: https://github.com/
|
169
|
+
homepage: https://github.com/projecthydra-labs/hydra-collections
|
171
170
|
licenses:
|
172
171
|
- APACHE2
|
173
172
|
metadata: {}
|
@@ -182,12 +181,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
181
|
version: '0'
|
183
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
183
|
requirements:
|
185
|
-
- - "
|
184
|
+
- - ">"
|
186
185
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
186
|
+
version: 1.3.1
|
188
187
|
requirements: []
|
189
188
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.
|
189
|
+
rubygems_version: 2.2.2
|
191
190
|
signing_key:
|
192
191
|
specification_version: 4
|
193
192
|
summary: A rails engine for managing Hydra Collections
|
@@ -198,7 +197,6 @@ test_files:
|
|
198
197
|
- spec/controllers/other_collections_controller_spec.rb
|
199
198
|
- spec/controllers/selects_collections_spec.rb
|
200
199
|
- spec/factories.rb
|
201
|
-
- spec/factories/.gitkeep
|
202
200
|
- spec/factories/users.rb
|
203
201
|
- spec/helpers/collections_helper_spec.rb
|
204
202
|
- spec/helpers/collections_search_helper_spec.rb
|
@@ -206,12 +204,11 @@ test_files:
|
|
206
204
|
- spec/lib/search_service_spec.rb
|
207
205
|
- spec/models/collection_spec.rb
|
208
206
|
- spec/spec_helper.rb
|
209
|
-
- spec/
|
210
|
-
- spec/
|
211
|
-
- spec/
|
212
|
-
- spec/
|
213
|
-
- spec/
|
214
|
-
- spec/
|
215
|
-
- spec/
|
216
|
-
- spec/
|
217
|
-
has_rdoc:
|
207
|
+
- spec/test_app_templates/app/models/sample.rb
|
208
|
+
- spec/test_app_templates/app/models/solr_document.rb
|
209
|
+
- spec/test_app_templates/app/views/catalog/_document_header.html.erb
|
210
|
+
- spec/test_app_templates/app/views/catalog/_index_collection.html.erb
|
211
|
+
- spec/test_app_templates/app/views/catalog/_sort_and_per_page.html.erb
|
212
|
+
- spec/test_app_templates/db/migrate/20111101221803_create_searches.rb
|
213
|
+
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
214
|
+
- spec/test_app_templates/lib/tasks/rspec.rake
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module Hydra
|
2
|
-
class CollectionRdfDatastream < ActiveFedora::NtriplesRDFDatastream
|
3
|
-
property :part_of, predicate: RDF::DC.isPartOf
|
4
|
-
property :contributor, predicate: RDF::DC.contributor do |index|
|
5
|
-
index.as :stored_searchable, :facetable
|
6
|
-
end
|
7
|
-
property :creator, predicate: RDF::DC.creator do |index|
|
8
|
-
index.as :stored_searchable, :facetable
|
9
|
-
end
|
10
|
-
property :title, predicate: RDF::DC.title do |index|
|
11
|
-
index.as :stored_searchable
|
12
|
-
end
|
13
|
-
property :description, predicate: RDF::DC.description do |index|
|
14
|
-
index.type :text
|
15
|
-
index.as :stored_searchable
|
16
|
-
end
|
17
|
-
property :publisher, predicate: RDF::DC.publisher do |index|
|
18
|
-
index.as :stored_searchable, :facetable
|
19
|
-
end
|
20
|
-
property :date_created, predicate: RDF::DC.created do |index|
|
21
|
-
index.as :stored_searchable
|
22
|
-
end
|
23
|
-
property :date_uploaded, predicate: RDF::DC.dateSubmitted do |index|
|
24
|
-
index.type :date
|
25
|
-
index.as :stored_sortable
|
26
|
-
end
|
27
|
-
property :date_modified, predicate: RDF::DC.modified do |index|
|
28
|
-
index.type :date
|
29
|
-
index.as :stored_sortable
|
30
|
-
end
|
31
|
-
property :subject, predicate: RDF::DC.subject do |index|
|
32
|
-
index.as :stored_searchable, :facetable
|
33
|
-
end
|
34
|
-
property :language, predicate: RDF::DC.language do |index|
|
35
|
-
index.as :stored_searchable, :facetable
|
36
|
-
end
|
37
|
-
property :rights, predicate: RDF::DC.rights do |index|
|
38
|
-
index.as :stored_searchable
|
39
|
-
end
|
40
|
-
property :resource_type, predicate: RDF::DC.type do |index|
|
41
|
-
index.as :stored_searchable, :facetable
|
42
|
-
end
|
43
|
-
property :identifier, predicate: RDF::DC.identifier do |index|
|
44
|
-
index.as :stored_searchable
|
45
|
-
end
|
46
|
-
property :based_near, predicate: RDF::FOAF.based_near do |index|
|
47
|
-
index.as :stored_searchable, :facetable
|
48
|
-
end
|
49
|
-
property :tag, predicate: RDF::DC.relation do |index|
|
50
|
-
index.as :stored_searchable, :facetable
|
51
|
-
end
|
52
|
-
property :related_url, predicate: RDF::RDFS.seeAlso
|
53
|
-
|
54
|
-
def prefix
|
55
|
-
""
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
data/spec/factories/.gitkeep
DELETED
File without changes
|