dor-services 4.9.0 → 4.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dor/services/archive_workspace_service.rb +19 -0
- data/lib/dor/version.rb +1 -1
- metadata +3 -2
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dor
|
2
|
+
|
3
|
+
# Rename the druid trees at the end of the accessionWF in order to be cleaned/deleted later.
|
4
|
+
class ArchiveWorkspaceService
|
5
|
+
|
6
|
+
def self.archive_workspace_druid_tree(druid, version, workspace_root)
|
7
|
+
|
8
|
+
druid_tree_path = DruidTools::Druid.new(druid, workspace_root).pathname.to_s
|
9
|
+
|
10
|
+
raise "The archived directory #{druid_tree_path}_v#{version} already existed." if File.exists?("#{druid_tree_path}_v#{version}")
|
11
|
+
|
12
|
+
if File.exists?(druid_tree_path)
|
13
|
+
FileUtils.mv(druid_tree_path, "#{druid_tree_path}_v#{version}")
|
14
|
+
end #Else is a truncated tree where we shouldn't do anything
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/lib/dor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.11.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2014-07-
|
16
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: active-fedora
|
@@ -597,6 +597,7 @@ files:
|
|
597
597
|
- lib/dor/models/upgradable.rb
|
598
598
|
- lib/dor/models/versionable.rb
|
599
599
|
- lib/dor/models/workflow_object.rb
|
600
|
+
- lib/dor/services/archive_workspace_service.rb
|
600
601
|
- lib/dor/services/cleanup_service.rb
|
601
602
|
- lib/dor/services/digital_stacks_service.rb
|
602
603
|
- lib/dor/services/merge_service.rb
|