curation_concerns-models 0.6.0 → 0.7.0

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
  SHA1:
3
- metadata.gz: 1ee33d07e558f4b7b09fdfc143622e41c840deb7
4
- data.tar.gz: b369d41f6e0e124d635812208b2b0c922d4626c0
3
+ metadata.gz: 751ba26c49fed8bea1d1370b62c9328c79557fc5
4
+ data.tar.gz: 02b5c38026d958d476706fa702cdf89ae387eb12
5
5
  SHA512:
6
- metadata.gz: b8fd340a961cbcc0930b8344acd29d6aaad67ebe307db9bc3993e167ac72c4a81325ac10ab5c42ed8fb3399238eb7504cfd61df923857c854f79d9f313ca2302
7
- data.tar.gz: 0841f2b19fc34d54970627258bb62ff4d8ab0c1f8fc3181209a9f80f3f8b106b788b96c698f511fb885cfd080dee01d97fea95641a27a1708ee67a102a8bef49
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
- file_sets.each(&:destroy)
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.6'
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
- class_name = normalize_concern_name(cc_type)
123
- unless registered_curation_concern_types.include?(class_name)
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
- # Returns the class names (strings) of the registered curation concerns
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
- @registered_curation_concern_types ||= []
136
+ @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) }
132
137
  end
133
138
 
134
- # Returns the classes of the registered curation concerns
139
+ # @return [Array<Class>] the registered curation concerns
135
140
  def curation_concerns
136
141
  registered_curation_concern_types.map(&:constantize)
137
142
  end
@@ -1,5 +1,5 @@
1
1
  module CurationConcerns
2
2
  module Models
3
- VERSION = "0.6.0".freeze
3
+ VERSION = "0.7.0".freeze
4
4
  end
5
5
  end
@@ -1,6 +1,5 @@
1
- namespace :curation_concerns do
1
+ namespace :curation_concerns do
2
2
  namespace :migrate do
3
-
4
3
  desc "Migrate audit logs"
5
4
  task audit_logs: :environment do
6
5
  ChecksumAuditLog.all.each do |cs|
@@ -8,6 +7,5 @@
8
7
  cs.save
9
8
  end
10
9
  end
11
-
12
10
  end
13
11
  end
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.6.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-01-26 00:00:00.000000000 Z
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.6'
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.6'
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