From 9b7956b4b9b6daa353ab045cdb6c99128a433443 Mon Sep 17 00:00:00 2001 From: Brian Hoffman Date: Thu, 17 Oct 2013 15:06:54 -0400 Subject: [PATCH 1/4] add zip dependency to Gemfile --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2c4eb87a..f967d1e0 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,6 @@ gem 'puma' gem 'rack' gem 'rack-protection' gem 'rack-test' -gem 'rake' gem 'rdoc' gem 'rspec' gem 'rubyzip' @@ -32,3 +31,4 @@ gem 'thread_safe' gem 'tilt' gem 'tzinfo' gem 'uglifier' +gem 'zip' \ No newline at end of file From 319d3722c4d781a4bdb3ba6629a4664e22a06ef6 Mon Sep 17 00:00:00 2001 From: Brian Hoffman Date: Thu, 17 Oct 2013 15:07:28 -0400 Subject: [PATCH 2/4] revert aspace vendor files to factory condition --- .../client_tools/v1.0.0/migrations/lib/parse_queue.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/vendor/archivesspace/client_tools/v1.0.0/migrations/lib/parse_queue.rb b/vendor/archivesspace/client_tools/v1.0.0/migrations/lib/parse_queue.rb index 75d5be09..860fc4f8 100644 --- a/vendor/archivesspace/client_tools/v1.0.0/migrations/lib/parse_queue.rb +++ b/vendor/archivesspace/client_tools/v1.0.0/migrations/lib/parse_queue.rb @@ -96,7 +96,6 @@ def save(&block) end end ensure - FileUtils.cp(@batch_file, "/Users/hoffman/Developer/Projects/archon-migration/batch_trace_#{Time.now.to_i}.txt") @batch_file.unlink end end From abb5223f4ecfb8d5e53b966dbda9d813d029e0c5 Mon Sep 17 00:00:00 2001 From: Brian Hoffman Date: Thu, 17 Oct 2013 17:37:21 -0400 Subject: [PATCH 3/4] create public directory if it doesn't exist --- app/main.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/main.rb b/app/main.rb index c23ae432..b889ae9f 100644 --- a/app/main.rb +++ b/app/main.rb @@ -35,6 +35,9 @@ require f end +public_dir = File.dirname(File.absolute_path(__FILE__)) + '/public' +Dir.mkdir(public_dir) unless File.exists?(public_dir) + get '/' do erb :index From cc719572ec914ced04d41d1b9e5201271ffbeba4 Mon Sep 17 00:00:00 2001 From: Brian Hoffman Date: Thu, 17 Oct 2013 17:38:33 -0400 Subject: [PATCH 4/4] allow for multiple entries in a position slot --- app/lib/migrate.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/lib/migrate.rb b/app/lib/migrate.rb index 74eb6f36..f1322cdf 100644 --- a/app/lib/migrate.rb +++ b/app/lib/migrate.rb @@ -194,7 +194,8 @@ def migrate_collection_content(repo_id, obj = obj_or_cont set_key = obj.parent.nil? ? nil : obj.parent['ref'] position_tracker[set_key] ||= {} - position_tracker[set_key][obj.position] = obj.key + position_tracker[set_key][obj.position] ||= [] + position_tracker[set_key][obj.position] << obj.key resolve_ids_to_links(rec, obj_or_cont, classification_map) @@ -223,13 +224,17 @@ def migrate_collection_content(repo_id, position_tracker.each do |id, map| sorted = map.keys.sort sorted.each_with_index do |padded_position, real_position| - position_map[map[padded_position]] = real_position + map[padded_position].each do |obj_key| + position_map[obj_key] = real_position + end end end batch.each do |obj| if position_map.has_key?(obj.key) obj.position = position_map[obj.key] + else + obj.position = nil end if (container_data_sets = container_trees[obj.key])