curation_concerns-models 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/concerns/curation_concerns/with_file_sets.rb +6 -1
- data/app/models/curation_concerns/classify_concern.rb +1 -1
- data/curation_concerns-models.gemspec +1 -1
- data/lib/curation_concerns/configuration.rb +12 -7
- data/lib/curation_concerns/models/version.rb +1 -1
- data/lib/tasks/migrate.rake +1 -3
- metadata +4 -5
- data/lib/tasks/curation_concerns-models_tasks.rake +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 751ba26c49fed8bea1d1370b62c9328c79557fc5
|
4
|
+
data.tar.gz: 02b5c38026d958d476706fa702cdf89ae387eb12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aca555d737b66f5ea3edec7e932dff73e583e4603bc0d49f84a703078acf31c25eda5b26e6b6d57d4f4faba305a8b20b676ecd01fee3707c299edfd1eb553e91
|
7
|
+
data.tar.gz: d16af7b1638fd15f5ec147e36842334b3d2c159f3e2456357e37691f379ce513b63f1669e38e3af70ccf7e32ffcf3795ba0c5b8038abb1045cea226f131ff59c
|
@@ -18,8 +18,13 @@ module CurationConcerns
|
|
18
18
|
# Destroy the list source first. This prevents each file_set from attemping to
|
19
19
|
# remove itself individually from the work. If hundreds of files are attached,
|
20
20
|
# this would take too long.
|
21
|
+
|
22
|
+
# Get list of member file_sets from Solr
|
23
|
+
fs = file_sets
|
21
24
|
list_source.destroy
|
22
|
-
|
25
|
+
# Remove Work from Solr after it was removed from Fedora
|
26
|
+
ActiveFedora::SolrService.delete(id)
|
27
|
+
fs.each(&:destroy)
|
23
28
|
end
|
24
29
|
|
25
30
|
def copy_visibility_to_files
|
@@ -25,7 +25,7 @@ module CurationConcerns
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def curation_concern_class
|
28
|
-
if possible_curation_concern_types.detect do|_name, class_name|
|
28
|
+
if possible_curation_concern_types.detect do |_name, class_name|
|
29
29
|
class_name == curation_concern_type
|
30
30
|
end
|
31
31
|
self.class.to_class(curation_concern_type)
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency 'active_attr'
|
23
23
|
spec.add_dependency 'hydra-collections', '~> 7.0'
|
24
24
|
spec.add_dependency 'hydra-head', '~> 9.3'
|
25
|
-
spec.add_dependency 'hydra-works', '~> 0.
|
25
|
+
spec.add_dependency 'hydra-works', '~> 0.7'
|
26
26
|
spec.add_dependency 'active_fedora-noid', '~> 1.0'
|
27
27
|
spec.add_dependency 'resque', '~> 1.23'
|
28
28
|
spec.add_dependency 'resque-pool', '~> 0.3'
|
@@ -14,12 +14,16 @@ module CurationConcerns
|
|
14
14
|
class Configuration
|
15
15
|
include Callbacks
|
16
16
|
|
17
|
+
def initialize
|
18
|
+
@registered_concerns = []
|
19
|
+
end
|
20
|
+
|
17
21
|
# An anonymous function that receives a path to a file
|
18
22
|
# and returns AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE if no
|
19
23
|
# virus is found; Any other returned value means a virus was found
|
20
24
|
attr_writer :default_antivirus_instance
|
21
25
|
def default_antivirus_instance
|
22
|
-
@default_antivirus_instance ||= lambda do|_file_path|
|
26
|
+
@default_antivirus_instance ||= lambda do |_file_path|
|
23
27
|
AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE
|
24
28
|
end
|
25
29
|
end
|
@@ -119,19 +123,20 @@ module CurationConcerns
|
|
119
123
|
# @param [Array<Symbol>,Symbol] curation_concern_types
|
120
124
|
def register_curation_concern(*curation_concern_types)
|
121
125
|
Array(curation_concern_types).flatten.compact.each do |cc_type|
|
122
|
-
|
123
|
-
|
124
|
-
registered_curation_concern_types << class_name
|
126
|
+
unless @registered_concerns.include?(cc_type)
|
127
|
+
@registered_concerns << cc_type
|
125
128
|
end
|
126
129
|
end
|
127
130
|
end
|
128
131
|
|
129
|
-
#
|
132
|
+
# The normalization done by this method must occur after the initialization process
|
133
|
+
# so it can take advantage of irregular inflections from config/initializers/inflections.rb
|
134
|
+
# @return [Array<String>] the class names of the registered curation concerns
|
130
135
|
def registered_curation_concern_types
|
131
|
-
@
|
136
|
+
@registered_concerns.map { |cc_type| normalize_concern_name(cc_type) }
|
132
137
|
end
|
133
138
|
|
134
|
-
#
|
139
|
+
# @return [Array<Class>] the registered curation concerns
|
135
140
|
def curation_concerns
|
136
141
|
registered_curation_concern_types.map(&:constantize)
|
137
142
|
end
|
data/lib/tasks/migrate.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: curation_concerns-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_attr
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0.
|
61
|
+
version: '0.7'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0.
|
68
|
+
version: '0.7'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: active_fedora-noid
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -259,7 +259,6 @@ files:
|
|
259
259
|
- lib/generators/curation_concerns/models/templates/migrations/create_checksum_audit_logs.rb
|
260
260
|
- lib/generators/curation_concerns/models/templates/migrations/create_single_use_links.rb
|
261
261
|
- lib/generators/curation_concerns/models/templates/migrations/create_version_committers.rb
|
262
|
-
- lib/tasks/curation_concerns-models_tasks.rake
|
263
262
|
- lib/tasks/migrate.rake
|
264
263
|
- lib/tasks/resque.rake
|
265
264
|
- lib/tasks/solr_reindex.rake
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import File.join(Gem::Specification.find_by_name('hydra-works').gem_dir,
|
2
|
-
'lib/tasks/hydra-works_tasks.rake')
|
3
|
-
|
4
|
-
namespace :curation_concerns do
|
5
|
-
namespace :jetty do
|
6
|
-
|
7
|
-
desc 'Configure jetty with full-text indexing'
|
8
|
-
task config: :download_jars do
|
9
|
-
Rake::Task['jetty:config'].invoke
|
10
|
-
end
|
11
|
-
|
12
|
-
desc 'Download Solr full-text extraction jars using Hydra::Works'
|
13
|
-
task :download_jars do
|
14
|
-
Rake::Task['hydra_works:jetty:download_jars'].invoke
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|