hydra-collections 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/CONTRIBUTING.md +113 -0
- data/Changelog.md +105 -0
- data/LICENSE.txt +12 -19
- data/README.md +67 -22
- data/{lib → app/controllers/concerns}/hydra/collections_controller_behavior.rb +29 -38
- data/app/helpers/collections_helper.rb +10 -0
- data/app/helpers/collections_search_helper.rb +6 -30
- data/{lib → app/models/concerns}/hydra/collection.rb +0 -8
- data/app/views/collections/_button_for_delete_collection.html.erb +1 -1
- data/app/views/collections/_button_remove_from_collection.html.erb +1 -1
- data/app/views/collections/_form.html.erb +2 -6
- data/app/views/collections/_form_for_select_destination_collection.html.erb +21 -0
- data/app/views/collections/_single_item_action_fields.html.erb +1 -1
- data/gemfiles/rails3.gemfile +6 -0
- data/gemfiles/rails4.gemfile +6 -0
- data/hydra-collections.gemspec +1 -0
- data/lib/hydra/collections/collectible.rb +1 -1
- data/lib/hydra/collections/selects_collections.rb +17 -5
- data/lib/hydra/collections/version.rb +1 -1
- data/lib/hydra/datastreams/collection_rdf_datastream.rb +0 -7
- data/lib/hydra-collections.rb +20 -7
- data/spec/controllers/accepts_batches_spec.rb +4 -4
- data/spec/controllers/collections_controller_spec.rb +46 -27
- data/spec/controllers/other_collections_controller_spec.rb +74 -0
- data/spec/controllers/selects_collections_spec.rb +11 -0
- data/spec/helpers/collections_helper_spec.rb +98 -40
- data/spec/helpers/collections_search_helper_spec.rb +5 -34
- data/spec/models/collection_spec.rb +30 -2
- data/spec/spec_helper.rb +7 -0
- data/tasks/hydra-collections-dev.rake +12 -6
- metadata +31 -7
- data/lib/hydra/collections.rb +0 -14
- data/spec/support/Gemfile +0 -19
@@ -94,7 +94,35 @@ describe Collection do
|
|
94
94
|
@collection.members = [@gf1, @gf2]
|
95
95
|
@collection.save
|
96
96
|
@collection.destroy
|
97
|
-
|
98
|
-
|
97
|
+
GenericFile.exists?(@gf1.pid).should be_true
|
98
|
+
GenericFile.exists?(@gf2.pid).should be_true
|
99
99
|
end
|
100
|
+
|
101
|
+
describe "Collection by another name" do
|
102
|
+
before (:all) do
|
103
|
+
class OtherCollection < ActiveFedora::Base
|
104
|
+
include Hydra::Collection
|
105
|
+
include Hydra::Collections::Collectible
|
106
|
+
end
|
107
|
+
class Member < ActiveFedora::Base
|
108
|
+
include Hydra::Collections::Collectible
|
109
|
+
end
|
110
|
+
end
|
111
|
+
after(:all) do
|
112
|
+
Object.send(:remove_const, :OtherCollection)
|
113
|
+
Object.send(:remove_const, :Member)
|
114
|
+
end
|
115
|
+
|
116
|
+
it "have members that know about the collection" do
|
117
|
+
collection = OtherCollection.new
|
118
|
+
member = Member.create
|
119
|
+
collection.members << member
|
120
|
+
collection.save
|
121
|
+
member.reload
|
122
|
+
member.collections.should == [collection]
|
123
|
+
collection.destroy
|
124
|
+
member.destroy
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
100
128
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,10 +9,17 @@ require 'hydra-collections'
|
|
9
9
|
FactoryGirl.definition_file_paths = [File.expand_path("../factories", __FILE__)]
|
10
10
|
FactoryGirl.find_definitions
|
11
11
|
|
12
|
+
module EngineRoutes
|
13
|
+
def self.included(base)
|
14
|
+
base.routes { Hydra::Collections::Engine.routes }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
RSpec.configure do |config|
|
13
19
|
config.use_transactional_fixtures = true
|
14
20
|
config.include Devise::TestHelpers, :type => :controller
|
15
21
|
config.before(:each, :type=>"controller") { @routes = Hydra::Collections::Engine.routes }
|
22
|
+
config.include EngineRoutes, :type => :controller
|
16
23
|
end
|
17
24
|
|
18
25
|
module FactoryGirl
|
@@ -19,9 +19,11 @@ desc "Run specs"
|
|
19
19
|
# It's a regular rake task that calls the RSpec RakeTask that's defined in spec/support/lib/tasks/rspec.rake
|
20
20
|
task :spec => [:generate] do |t|
|
21
21
|
focused_spec = ENV['SPEC'] ? " SPEC=#{File.join(GEM_ROOT, ENV['SPEC'])}" : ''
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
@@ -30,8 +32,11 @@ task :generate do
|
|
30
32
|
unless File.exists?('spec/internal/Rakefile')
|
31
33
|
puts "Generating rails app"
|
32
34
|
`rails new spec/internal`
|
33
|
-
puts "
|
34
|
-
|
35
|
+
puts "Updating gemfile"
|
36
|
+
|
37
|
+
`echo "gem 'hydra-collections', :path=>'../../../hydra-collections'
|
38
|
+
gem 'factory_girl_rails'
|
39
|
+
" >> spec/internal/Gemfile`
|
35
40
|
puts "Copying generator"
|
36
41
|
`cp -r spec/support/lib/generators spec/internal/lib`
|
37
42
|
Bundler.with_clean_env do
|
@@ -40,7 +45,8 @@ task :generate do
|
|
40
45
|
`bundle install`
|
41
46
|
puts "running test_app_generator"
|
42
47
|
system "rails generate test_app"
|
43
|
-
|
48
|
+
# These factories are autogenerated and conflict with our factories
|
49
|
+
system 'rm test/factories/users.rb'
|
44
50
|
puts "running migrations"
|
45
51
|
puts `rake db:migrate db:test:prepare`
|
46
52
|
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: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -80,6 +80,26 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: sass-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - <
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '5'
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '3.2'
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - <
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '5'
|
100
|
+
- - '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '3.2'
|
83
103
|
description: A rails engine for managing Hydra Collections
|
84
104
|
email:
|
85
105
|
- cam156@psu.edu
|
@@ -92,6 +112,8 @@ files:
|
|
92
112
|
- .ruby-gemset
|
93
113
|
- .ruby-version
|
94
114
|
- .travis.yml
|
115
|
+
- CONTRIBUTING.md
|
116
|
+
- Changelog.md
|
95
117
|
- Gemfile
|
96
118
|
- LICENSE.txt
|
97
119
|
- README.md
|
@@ -100,10 +122,12 @@ files:
|
|
100
122
|
- app/assets/javascripts/hydra_collections.js
|
101
123
|
- app/assets/stylesheets/hydra_collections.css.scss
|
102
124
|
- app/controllers/collections_controller.rb
|
125
|
+
- app/controllers/concerns/hydra/collections_controller_behavior.rb
|
103
126
|
- app/helpers/batch_select_helper.rb
|
104
127
|
- app/helpers/collections_helper.rb
|
105
128
|
- app/helpers/collections_search_helper.rb
|
106
129
|
- app/models/collection.rb
|
130
|
+
- app/models/concerns/hydra/collection.rb
|
107
131
|
- app/models/solr_document.rb
|
108
132
|
- app/views/batch_select/_add_button.html.erb
|
109
133
|
- app/views/batch_select/_check_all.html.erb
|
@@ -117,6 +141,7 @@ files:
|
|
117
141
|
- app/views/collections/_document_list.html.erb
|
118
142
|
- app/views/collections/_form.html.erb
|
119
143
|
- app/views/collections/_form_for_select_collection.html.erb
|
144
|
+
- app/views/collections/_form_for_select_destination_collection.html.erb
|
120
145
|
- app/views/collections/_search_form.html.erb
|
121
146
|
- app/views/collections/_single_item_action_fields.html.erb
|
122
147
|
- app/views/collections/edit.html.erb
|
@@ -126,17 +151,16 @@ files:
|
|
126
151
|
- config/routes.rb
|
127
152
|
- fedora_conf/conf/development/fedora.fcfg
|
128
153
|
- fedora_conf/conf/test/fedora.fcfg
|
154
|
+
- gemfiles/rails3.gemfile
|
155
|
+
- gemfiles/rails4.gemfile
|
129
156
|
- hydra-collections.gemspec
|
130
157
|
- lib/hydra-collections.rb
|
131
|
-
- lib/hydra/collection.rb
|
132
|
-
- lib/hydra/collections.rb
|
133
158
|
- lib/hydra/collections/accepts_batches.rb
|
134
159
|
- lib/hydra/collections/collectible.rb
|
135
160
|
- lib/hydra/collections/search_service.rb
|
136
161
|
- lib/hydra/collections/selects_collections.rb
|
137
162
|
- lib/hydra/collections/solr_document_behavior.rb
|
138
163
|
- lib/hydra/collections/version.rb
|
139
|
-
- lib/hydra/collections_controller_behavior.rb
|
140
164
|
- lib/hydra/datastreams/collection_rdf_datastream.rb
|
141
165
|
- solr_conf/conf/schema.xml
|
142
166
|
- solr_conf/conf/solrconfig.xml
|
@@ -144,6 +168,7 @@ files:
|
|
144
168
|
- spec/controllers/accepts_batches_spec.rb
|
145
169
|
- spec/controllers/catalog_controller_spec.rb
|
146
170
|
- spec/controllers/collections_controller_spec.rb
|
171
|
+
- spec/controllers/other_collections_controller_spec.rb
|
147
172
|
- spec/controllers/selects_collections_spec.rb
|
148
173
|
- spec/factories.rb
|
149
174
|
- spec/factories/.gitkeep
|
@@ -154,7 +179,6 @@ files:
|
|
154
179
|
- spec/lib/search_service_spec.rb
|
155
180
|
- spec/models/collection_spec.rb
|
156
181
|
- spec/spec_helper.rb
|
157
|
-
- spec/support/Gemfile
|
158
182
|
- spec/support/app/models/sample.rb
|
159
183
|
- spec/support/app/models/solr_document.rb
|
160
184
|
- spec/support/app/views/catalog/_document_header.html.erb
|
@@ -193,6 +217,7 @@ test_files:
|
|
193
217
|
- spec/controllers/accepts_batches_spec.rb
|
194
218
|
- spec/controllers/catalog_controller_spec.rb
|
195
219
|
- spec/controllers/collections_controller_spec.rb
|
220
|
+
- spec/controllers/other_collections_controller_spec.rb
|
196
221
|
- spec/controllers/selects_collections_spec.rb
|
197
222
|
- spec/factories.rb
|
198
223
|
- spec/factories/.gitkeep
|
@@ -203,7 +228,6 @@ test_files:
|
|
203
228
|
- spec/lib/search_service_spec.rb
|
204
229
|
- spec/models/collection_spec.rb
|
205
230
|
- spec/spec_helper.rb
|
206
|
-
- spec/support/Gemfile
|
207
231
|
- spec/support/app/models/sample.rb
|
208
232
|
- spec/support/app/models/solr_document.rb
|
209
233
|
- spec/support/app/views/catalog/_document_header.html.erb
|
data/lib/hydra/collections.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
module Hydra
|
2
|
-
module Collections
|
3
|
-
extend ActiveSupport::Autoload
|
4
|
-
autoload :Version
|
5
|
-
autoload :Collectible
|
6
|
-
autoload :SearchService
|
7
|
-
autoload :AcceptsBatches
|
8
|
-
autoload :SelectsCollections
|
9
|
-
autoload :SolrDocumentBehavior
|
10
|
-
class Engine < ::Rails::Engine
|
11
|
-
engine_name "collections"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/spec/support/Gemfile
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'rails'
|
4
|
-
gem 'sqlite3'
|
5
|
-
gem 'devise'
|
6
|
-
gem 'hydra-head'
|
7
|
-
gem 'hydra-collections', :path=>'../../'
|
8
|
-
|
9
|
-
gem 'rspec-rails'
|
10
|
-
gem 'factory_girl'
|
11
|
-
|
12
|
-
# Gems used only for assets and not required
|
13
|
-
# in production environments by default.
|
14
|
-
group :assets do
|
15
|
-
gem 'sass-rails', '~> 3.2.3'
|
16
|
-
gem 'coffee-rails', '~> 3.2.1'
|
17
|
-
gem 'jquery-rails'
|
18
|
-
gem 'uglifier', '>= 1.0.3'
|
19
|
-
end
|