hydra-works 0.4.0 → 0.5.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: 5ebd42d5d4c7bf8bdd3b2dab8dfce732125c35ed
4
- data.tar.gz: 3bd2bc2c16daac53f092b7435218906b3f0fcb6d
3
+ metadata.gz: dccbd98c61c1d4f18a6638c637c52adb8414c39b
4
+ data.tar.gz: 898863dcf45f52862fddebd401c31d31a7384ee2
5
5
  SHA512:
6
- metadata.gz: b2eda186b0a5c27a5c6901e6f9be86079f47076035d485b01d6cebb31df724dc23ba3da8cd39296b66273796df2278e85f0cb222e2a25673bd9e2edf9f47f456
7
- data.tar.gz: b29ccf5e084c04bc7e51dda1e1c236a03a52f1a65de0f9cbc69894d72b449259e0d723239e55c079279cc32d1598f26553e9a3e2d06a969e8c70e9d51ec578a2
6
+ metadata.gz: 5b895ae5c78efa14c537173445f3d8b70304e4ff5462912839ffae55bb96162c867066b15c55d0315cd7de2146da6bcf911f27c3a7b2502fd0228a05bf532d80
7
+ data.tar.gz: 526f699b440f37454b043a1e8127c93e42ff31a404ec9c487f0eeb15471feeda07abaf02aea2382e063360a25c06962a9d3bef79bc61107573ac6d8b74717838
data/hydra-works.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['justin@curationexperts.com']
11
11
  spec.summary = %q{Fundamental repository data model for hydra}
12
12
  spec.description = %q{Using this data model should enable easy collaboration amongst hydra projects.}
13
- spec.homepage = ''
13
+ spec.homepage = 'https://github.com/projecthydra-labs/hydra-works'
14
14
  spec.license = 'APACHE2'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
data/lib/hydra/works.rb CHANGED
@@ -28,22 +28,17 @@ module Hydra
28
28
  autoload :Collection
29
29
  autoload :FileSet
30
30
  autoload :GenericWork
31
- autoload :GenericFile # Deprecated. Remove in 0.4.0
32
31
  end
33
32
 
34
33
  autoload_under 'models/concerns' do
35
34
  autoload :CollectionBehavior
36
35
  autoload :FileSetBehavior
37
- autoload :GenericWorkBehavior # Deprecated. Remove in 0.4.0
38
- autoload :GenericFileBehavior # Deprecated. Remove in 0.4.0
39
36
  autoload :WorkBehavior
40
37
  end
41
38
 
42
39
  autoload_under 'services' do
43
40
  autoload :AddFileToFileSet
44
- autoload :AddFileToGenericFile # Deprecated. Remove in 0.4.0
45
41
  autoload :UploadFileToFileSet
46
- autoload :UploadFileToGenericFile # Deprecated. Remove in 0.4.0
47
42
  autoload :PersistDerivative
48
43
  autoload :CharacterizationService
49
44
  end
@@ -15,15 +15,10 @@ module Hydra::Works
15
15
  # 9) Hydra::Works::Collection can have access metadata
16
16
  module CollectionBehavior
17
17
  extend ActiveSupport::Concern
18
- extend Deprecation
19
- self.deprecation_horizon = "Hydra::Works 0.4.0"
20
18
  include Hydra::PCDM::CollectionBehavior
21
19
 
22
20
  included do
23
21
  type [Hydra::PCDM::Vocab::PCDMTerms.Collection, Vocab::WorksTerms.Collection]
24
-
25
- alias_method :generic_works, :works
26
- deprecation_deprecate :generic_works
27
22
  end
28
23
 
29
24
  def ordered_works
@@ -47,23 +42,14 @@ module Hydra::Works
47
42
  true
48
43
  end
49
44
 
50
- alias_method :works_collection?, :collection?
51
- deprecation_deprecate :works_collection?
52
-
53
45
  # @return [Boolean] whether this instance is a Hydra::Works Generic Work.
54
46
  def work?
55
47
  false
56
48
  end
57
49
 
58
- alias_method :works_generic_work?, :work?
59
- deprecation_deprecate :works_generic_work?
60
-
61
50
  # @return [Boolean] whether this instance is a Hydra::Works::FileSet.
62
51
  def file_set?
63
52
  false
64
53
  end
65
-
66
- alias_method :works_generic_file?, :file_set?
67
- deprecation_deprecate :works_generic_file?
68
54
  end
69
55
  end
@@ -10,8 +10,6 @@ module Hydra::Works
10
10
  # 6) Hydra::Works::FileSet can have access metadata
11
11
  module FileSetBehavior
12
12
  extend ActiveSupport::Concern
13
- extend Deprecation
14
- self.deprecation_horizon = "Hydra::Works 0.4.0"
15
13
  include Hydra::PCDM::ObjectBehavior
16
14
 
17
15
  included do
@@ -28,30 +26,18 @@ module Hydra::Works
28
26
  false
29
27
  end
30
28
 
31
- alias_method :works_collection?, :collection?
32
- deprecation_deprecate :works_collection?
33
-
34
29
  # @return [Boolean] whether this instance is a Hydra::Works Generic Work.
35
30
  def work?
36
31
  false
37
32
  end
38
33
 
39
- alias_method :works_generic_work?, :work?
40
- deprecation_deprecate :works_generic_work?
41
-
42
34
  # @return [Boolean] whether this instance is a Hydra::Works::FileSet.
43
35
  def file_set?
44
36
  true
45
37
  end
46
38
 
47
- alias_method :works_generic_file?, :file_set?
48
- deprecation_deprecate :works_generic_file?
49
-
50
39
  def in_works
51
40
  ordered_by.select { |parent| parent.class.included_modules.include?(Hydra::Works::WorkBehavior) }.to_a
52
41
  end
53
-
54
- alias_method :in_generic_works, :in_works
55
- deprecation_deprecate :in_generic_works
56
42
  end
57
43
  end
@@ -14,17 +14,10 @@ module Hydra::Works
14
14
  # 10) Hydra::Works::Work can have access metadata
15
15
  module WorkBehavior
16
16
  extend ActiveSupport::Concern
17
- extend Deprecation
18
- self.deprecation_horizon = "Hydra::Works 0.4.0"
19
17
  include Hydra::PCDM::ObjectBehavior
20
18
 
21
19
  included do
22
20
  type [Hydra::PCDM::Vocab::PCDMTerms.Object, Vocab::WorksTerms.Work]
23
-
24
- alias_method :generic_works, :ordered_works
25
- deprecation_deprecate :generic_works
26
-
27
- alias_method :generic_files, :ordered_file_sets
28
21
  end
29
22
 
30
23
  def works
@@ -64,30 +57,18 @@ module Hydra::Works
64
57
  false
65
58
  end
66
59
 
67
- alias_method :works_collection?, :collection?
68
- deprecation_deprecate :works_collection?
69
-
70
60
  # @return [Boolean] whether this instance is a Hydra::Works Generic Work.
71
61
  def work?
72
62
  true
73
63
  end
74
64
 
75
- alias_method :works_generic_work?, :work?
76
- deprecation_deprecate :works_generic_work?
77
-
78
65
  # @return [Boolean] whether this instance is a Hydra::Works::FileSet.
79
66
  def file_set?
80
67
  false
81
68
  end
82
69
 
83
- alias_method :works_generic_file?, :file_set?
84
- deprecation_deprecate :works_generic_file?
85
-
86
70
  def in_works
87
71
  ordered_by.select { |parent| parent.class.included_modules.include?(Hydra::Works::WorkBehavior) }.to_a
88
72
  end
89
-
90
- alias_method :in_generic_works, :in_works
91
- deprecation_deprecate :in_generic_works
92
73
  end
93
74
  end
@@ -5,16 +5,5 @@ module Hydra::Works
5
5
  # include Hydra::Works::WorkBehavior
6
6
  class GenericWork < ActiveFedora::Base
7
7
  include Hydra::Works::WorkBehavior
8
-
9
- # @deprecated Base class for creating objects that behave like Hydra::Works::GenericWorks
10
- class Base < ActiveFedora::Base
11
- extend Deprecation
12
- after_initialize :deprecated_warning
13
- include Hydra::Works::WorkBehavior
14
-
15
- def deprecated_warning
16
- Deprecation.warn(Base, "GenericWork is deprecated and will be removed in Hydra::Works 0.4.0. Use Hydra::Works::GenericWork instead")
17
- end
18
- end
19
8
  end
20
9
  end
@@ -1,22 +1,22 @@
1
1
  module Hydra::Works
2
2
  class UploadFileToFileSet
3
- # Sets a file as the primary file (original_file) of the generic_file
4
- # @param [Hydra::PCDM::FileSet] generic_file the file will be added to
3
+ # Sets a file as the primary file (original_file) of the file_set
4
+ # @param [Hydra::PCDM::FileSet] file_set the file will be added to
5
5
  # @param [IO,File,Rack::Multipart::UploadedFile, #read] object that will be the contents. If file responds to :mime_type or :original_name, those will be called to provide technical metadata.
6
- # @param [Array] additional_services (ie Generating Thumbnails) to call with generic_file after adding the file as its original_file
7
- # @param [Boolean] update_existing whether to update an existing file if there is one. When set to true, performs a create_or_update. When set to false, always creates a new file within generic_file.files.
6
+ # @param [Array] additional_services (ie Generating Thumbnails) to call with file_set after adding the file as its original_file
7
+ # @param [Boolean] update_existing whether to update an existing file if there is one. When set to true, performs a create_or_update. When set to false, always creates a new file within file_set.files.
8
8
  # @param [Boolean] versioning whether to create new version entries (only applicable if +type+ corresponds to a versionable file)
9
9
 
10
- def self.call(generic_file, file, additional_services: [], update_existing: true, versioning: true)
11
- Hydra::Works::AddFileToFileSet.call(generic_file, file, :original_file, update_existing: update_existing, versioning: versioning)
10
+ def self.call(file_set, file, additional_services: [], update_existing: true, versioning: true)
11
+ Hydra::Works::AddFileToFileSet.call(file_set, file, :original_file, update_existing: update_existing, versioning: versioning)
12
12
 
13
13
  # Call any additional services
14
14
  additional_services.each do |service|
15
- service.call(generic_file)
15
+ service.call(file_set)
16
16
  end
17
17
 
18
- generic_file.save
19
- generic_file
18
+ file_set.save
19
+ file_set
20
20
  end
21
21
  end
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Hydra
2
2
  module Works
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
@@ -38,17 +38,26 @@ namespace :hydra_works do
38
38
  )
39
39
 
40
40
  desc 'Configure jetty with full-text indexing'
41
- task config: :download_jars do
41
+ task config: [:generate_config, :download_jars] do
42
42
  Rake::Task['jetty:config'].invoke
43
43
  end
44
44
 
45
- desc 'Download Solr full-text extraction jars'
46
- task :download_jars do
47
- puts "Copying new solrconfig.xml"
45
+ desc 'Generate a Solr config with full-text extraction'
46
+ task :generate_config do
47
+ puts "Generating a solrconfig.xml configured for full-text extraction"
48
48
  source = File.join(File.dirname(__FILE__), '..', '..', 'config', 'solrconfig.xml')
49
49
  dest = File.join('solr_conf','conf')
50
50
  FileUtils.mkdir_p(dest) unless File.directory?(dest)
51
- cp source, dest
51
+ dest_file = File.join(dest, 'solrconfig.xml')
52
+ if File.exist?(dest_file)
53
+ puts "Skipping. #{dest_file} already exists."
54
+ else
55
+ cp source, dest
56
+ end
57
+ end
58
+
59
+ desc 'Download Solr full-text extraction jars'
60
+ task :download_jars do
52
61
  puts "Downloading full-text jars from maven.org ..."
53
62
  fulltext_dir = 'jetty/solr/lib/contrib/extraction/lib'
54
63
  FileUtils.mkdir_p(fulltext_dir) unless File.directory?(fulltext_dir)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-works
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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: 2015-11-04 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hydra-pcdm
@@ -212,19 +212,14 @@ files:
212
212
  - lib/hydra/works/models/concerns/file_set/versioned_content.rb
213
213
  - lib/hydra/works/models/concerns/file_set/virus_check.rb
214
214
  - lib/hydra/works/models/concerns/file_set_behavior.rb
215
- - lib/hydra/works/models/concerns/generic_file_behavior.rb
216
- - lib/hydra/works/models/concerns/generic_work_behavior.rb
217
215
  - lib/hydra/works/models/concerns/work_behavior.rb
218
216
  - lib/hydra/works/models/file_set.rb
219
- - lib/hydra/works/models/generic_file.rb
220
217
  - lib/hydra/works/models/generic_work.rb
221
218
  - lib/hydra/works/models/work.rb
222
219
  - lib/hydra/works/services/add_file_to_file_set.rb
223
- - lib/hydra/works/services/add_file_to_generic_file.rb
224
220
  - lib/hydra/works/services/characterization_service.rb
225
221
  - lib/hydra/works/services/persist_derivative.rb
226
222
  - lib/hydra/works/services/upload_file_to_file_set.rb
227
- - lib/hydra/works/services/upload_file_to_generic_file.rb
228
223
  - lib/hydra/works/version.rb
229
224
  - lib/hydra/works/vocab/works_terms.rb
230
225
  - lib/tasks/hydra-works_tasks.rake
@@ -255,7 +250,7 @@ files:
255
250
  - spec/hydra/works/models/concerns/file_set/versioned_content_spec.rb
256
251
  - spec/hydra/works/models/concerns/file_set/virus_check_spec.rb
257
252
  - spec/hydra/works/models/concerns/file_set_behavior_spec.rb
258
- - spec/hydra/works/models/generic_file_spec.rb
253
+ - spec/hydra/works/models/file_set_spec.rb
259
254
  - spec/hydra/works/models/generic_work_spec.rb
260
255
  - spec/hydra/works/services/add_file_to_file_set_spec.rb
261
256
  - spec/hydra/works/services/characterization_service_spec.rb
@@ -273,7 +268,7 @@ files:
273
268
  - use-cases/scholarsphere_use_case.md
274
269
  - use-cases/stanford_data_model_use_case.md
275
270
  - use-cases/ucin_linked_resource_use_case.md
276
- homepage: ''
271
+ homepage: https://github.com/projecthydra-labs/hydra-works
277
272
  licenses:
278
273
  - APACHE2
279
274
  metadata: {}
@@ -293,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
288
  version: '0'
294
289
  requirements: []
295
290
  rubyforge_project:
296
- rubygems_version: 2.4.5.1
291
+ rubygems_version: 2.5.0
297
292
  signing_key:
298
293
  specification_version: 4
299
294
  summary: Fundamental repository data model for hydra
@@ -324,7 +319,7 @@ test_files:
324
319
  - spec/hydra/works/models/concerns/file_set/versioned_content_spec.rb
325
320
  - spec/hydra/works/models/concerns/file_set/virus_check_spec.rb
326
321
  - spec/hydra/works/models/concerns/file_set_behavior_spec.rb
327
- - spec/hydra/works/models/generic_file_spec.rb
322
+ - spec/hydra/works/models/file_set_spec.rb
328
323
  - spec/hydra/works/models/generic_work_spec.rb
329
324
  - spec/hydra/works/services/add_file_to_file_set_spec.rb
330
325
  - spec/hydra/works/services/characterization_service_spec.rb
@@ -333,4 +328,3 @@ test_files:
333
328
  - spec/hydra/works_spec.rb
334
329
  - spec/spec_helper.rb
335
330
  - spec/support/file_set_helper.rb
336
- has_rdoc:
@@ -1,12 +0,0 @@
1
- module Hydra::Works
2
- # @deprecated use FileSetBehavior instead
3
- module GenericFileBehavior
4
- extend ActiveSupport::Concern
5
- extend Deprecation
6
-
7
- included do
8
- Deprecation.warn GenericFileBehavior, "GenericFileBehavior is deprecated. Use FileSetBehavior instead. This will be removed in Hydra::Works 0.4.0"
9
- include FileSetBehavior
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- module Hydra::Works
2
- # @deprecated use Hydra::Works::WorkBehavior instead
3
- module GenericWorkBehavior
4
- extend ActiveSupport::Concern
5
- extend Deprecation
6
- self.deprecation_horizon = "Hydra::Works 0.4.0"
7
- included do
8
- Deprecation.warn self, "GenericWorkBehavior is deprecated. Use WorkBehavior instead. This module will be removed in Hydra::Works 0.4.0"
9
- include Hydra::Works::WorkBehavior
10
- end
11
- end
12
- end
@@ -1,17 +0,0 @@
1
- module Hydra::Works
2
- # Namespace for Modules with functionality specific to GenericFiles
3
- module GenericFile
4
- extend ActiveSupport::Concern
5
-
6
- # @deprecated Base class for creating objects that behave like Hydra::Works::GenericFiles
7
- class Base < ActiveFedora::Base
8
- extend Deprecation
9
- include Hydra::Works::FileSetBehavior
10
- after_initialize :deprecation_warning
11
-
12
- def deprecation_warning
13
- Deprecation.warn Base, "Hydra::Works::FileSet is deprecated and will be removed in 0.4.0. Use Hydra::Works::FileSet instead"
14
- end
15
- end
16
- end
17
- end
@@ -1,8 +0,0 @@
1
- module Hydra::Works
2
- class AddFileToGenericFile
3
- def self.call(*args)
4
- Deprecation.warn(AddFileToGenericFile, "AddFileToGenericFile is deprecated use AddFileToFileSet. This will be removed in 0.4.0")
5
- AddFileToFileSet.call(*args)
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Hydra::Works
2
- class UploadFileToGenericFile
3
- def self.call(*args)
4
- Deprecation.warn(UploadFileToGenericFile, "UploadFileToGenericFile is deprecated use UploadFileToFileSet. This will be removed in 0.4.0")
5
- UploadFileToFileSet.call(*args)
6
- end
7
- end
8
- end