moab-versioning 4.2.0 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,6 @@ require 'moab/stanford'
2
2
  require 'druid-tools'
3
3
 
4
4
  module Stanford
5
-
6
5
  # A class to represent the SDR repository store
7
6
  #
8
7
  # ====Data Model
@@ -11,7 +10,6 @@ module Stanford
11
10
  # @note Copyright (c) 2012 by The Board of Trustees of the Leland Stanford Junior University.
12
11
  # All rights reserved. See {file:LICENSE.rdoc} for details.
13
12
  class StorageRepository < Moab::StorageRepository
14
-
15
13
  # @param object_id [String] The identifier of the digital object
16
14
  # @return [String] The branch segment of the object storage path
17
15
  def storage_branch(object_id)
@@ -40,7 +38,5 @@ module Stanford
40
38
  raise syntax_msg unless DruidTools::Druid.valid?(identifier, true)
41
39
  DruidTools::Druid.new(identifier, true).tree.join(File::SEPARATOR)
42
40
  end
43
-
44
41
  end
45
-
46
42
  end
@@ -1,10 +1,8 @@
1
1
  require 'moab/stanford'
2
2
 
3
3
  module Stanford
4
-
5
4
  # An interface class to support access to SDR storage via a RESTful server
6
5
  class StorageServices < Moab::StorageServices
7
-
8
6
  # @return [StorageRepository] an instance of the interface to SDR storage
9
7
  @@repository = Stanford::StorageRepository.new
10
8
 
@@ -15,7 +13,7 @@ module Stanford
15
13
  # contentMetadata (all|preserve|publish|shelve)
16
14
  # @param base_version [Integer] The ID of the version whose inventory is the basis of, if nil use latest version
17
15
  # @return [FileInventoryDifference] The report of differences between the content metadata and the specified version
18
- def self.compare_cm_to_version(new_content_metadata, object_id, subset, base_version=nil)
16
+ def self.compare_cm_to_version(new_content_metadata, object_id, subset, base_version = nil)
19
17
  new_inventory = Stanford::ContentInventory.new.inventory_from_cm(new_content_metadata, object_id, subset)
20
18
  begin
21
19
  # ObjectNotFoundException is raised if the object does not exist in storage
@@ -26,7 +24,7 @@ module Stanford
26
24
  rescue Moab::ObjectNotFoundException, Moab::FileNotFoundException
27
25
  # Create a skeletal FileInventory object, containing no file entries
28
26
  storage_object = Moab::StorageObject.new(object_id, 'dummy')
29
- base_version = Moab::StorageObjectVersion.new(storage_object,0)
27
+ base_version = Moab::StorageObjectVersion.new(storage_object, 0)
30
28
  base_inventory = base_version.file_inventory('version')
31
29
  end
32
30
  diff = Moab::FileInventoryDifference.new.compare(base_inventory, new_inventory)
@@ -39,7 +37,7 @@ module Stanford
39
37
  # @param object_id [String] The digital object identifier of the object whose signature catalog is to be used
40
38
  # @param version_id [Integer] The ID of the version whose signature catalog is to be used, if nil use latest version
41
39
  # @return [FileInventory] The versionAddtions report showing which files are new or modified in the content metadata
42
- def self.cm_version_additions(new_content_metadata, object_id, version_id=nil)
40
+ def self.cm_version_additions(new_content_metadata, object_id, version_id = nil)
43
41
  new_inventory = Stanford::ContentInventory.new.inventory_from_cm(new_content_metadata, object_id, 'preserve')
44
42
  begin
45
43
  # ObjectNotFoundException is raised if the object does not exist in storage
@@ -48,7 +46,7 @@ module Stanford
48
46
  signature_catalog = storage_object_version.signature_catalog
49
47
  rescue Moab::ObjectNotFoundException
50
48
  storage_object = Moab::StorageObject.new(object_id, 'dummy')
51
- base_version = Moab::StorageObjectVersion.new(storage_object,0)
49
+ base_version = Moab::StorageObjectVersion.new(storage_object, 0)
52
50
  signature_catalog = base_version.signature_catalog
53
51
  end
54
52
  signature_catalog.version_additions(new_inventory)
@@ -57,12 +55,10 @@ module Stanford
57
55
  # @param object_id [String] The digital object identifier of the object whose contentMetadata is to be remediated
58
56
  # @param version_id [Integer] The ID of the version whose file data is to be used, if nil use latest version
59
57
  # @return [String] Returns a remediated copy of the contentMetadata with fixity data filled in
60
- def self.cm_remediate(object_id, version_id=nil)
58
+ def self.cm_remediate(object_id, version_id = nil)
61
59
  cm = self.retrieve_file('metadata', 'contentMetadata.xml', object_id, version_id)
62
60
  group = self.retrieve_file_group('content', object_id, version_id)
63
- Stanford::ContentInventory.new.remediate_content_metadata(cm,group)
61
+ Stanford::ContentInventory.new.remediate_content_metadata(cm, group)
64
62
  end
65
-
66
63
  end
67
-
68
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moab-versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Weber
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-03-20 00:00:00.000000000 Z
14
+ date: 2018-04-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: confstruct