sdr-replication 0.5.1 → 0.6.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: b0cd75ee22bae7e3f87aac074f0f93a87e5d2d8c
4
- data.tar.gz: efc8329c92d6052156064b2e0316f2efe28e23ad
3
+ metadata.gz: c9045400c2d3a49bd77d96453b89c29e583db186
4
+ data.tar.gz: 93c1aa92f9486602fb623345265c5bb88c75dc54
5
5
  SHA512:
6
- metadata.gz: 5a2048fe858254429df0a55730a3a1cdb3d8d77867fc9c499d475be1fc73d0dc8e73a72271fb3f1ae497a4ccdb9a66cfd2bbd5653d61fb374cb32f4025fdb021
7
- data.tar.gz: 7df9ba8408b6e00de5326022be5cd0613c69e1aa4b981900f18001fe937bb01bf1ce3dddf325b0f81696cc7e0d10b2f9be483e6ac9ad14e0eeeb437e4db9025c
6
+ metadata.gz: ae096cda70bc1df8894a601da7b283d0b62f58e939828eba05e6ecfceb43b6ae0ba1e4fefbbd5eb8bc22a0ab6cce71c3dd4749f56488eaa78feda9e18a5d6f4b
7
+ data.tar.gz: 9622fb34001a5a062174cd5a972b98f7ef48faa970fd6888ee5478dcf8dd3c28129d445c05ffcc82c474bf86349fdb12270b7ecf60dfca67e6c9bdc67c2bcfd7
@@ -34,7 +34,7 @@ module Replication
34
34
  # @return [BagitBag] A bag containing a copy of the replica
35
35
  attr_accessor :bagit_bag
36
36
 
37
- # @return [Integer] The size (in bytes) of the replic bag's payload
37
+ # @return [Integer] The size (in bytes) of the replica bag's payload
38
38
  attr_accessor :payload_size
39
39
 
40
40
  # @return [String] The type of checksum/digest type (:sha1, :sha256)
@@ -3,6 +3,9 @@ require 'sdr_replication'
3
3
 
4
4
  module Replication
5
5
 
6
+ class ReplicaExistsError < RuntimeError
7
+ end
8
+
6
9
  #
7
10
  # @note Copyright (c) 2014 by The Board of Trustees of the Leland Stanford Junior University.
8
11
  # All rights reserved. See {file:LICENSE.rdoc} for details.
@@ -150,8 +153,10 @@ module Replication
150
153
  end
151
154
 
152
155
  # @return [Replica] Copy the object version into a BagIt Bag in tarfile format
156
+ # @raise [ReplicaExistsError] will not replace data in replica.bag_pathname
153
157
  def create_replica
154
158
  replica = self.replica
159
+ raise ReplicaExistsError if replica.bag_pathname.exist?
155
160
  bag = Archive::BagitBag.create_bag(replica.bag_pathname)
156
161
  bag.bag_checksum_types = [:sha256]
157
162
  bag.add_payload_tarfile("#{replica.replica_id}.tar",version_pathname, storage_object.object_pathname.parent)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdr-replication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Weber