Skip to content

Commit

Permalink
Merge pull request #4 from lcdhoffman/master
Browse files Browse the repository at this point in the history
Release Candidate 2
  • Loading branch information
quoideneuf committed Oct 17, 2013
2 parents 2f3cc8a + cc71957 commit 9dc7469
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ gem 'puma'
gem 'rack'
gem 'rack-protection'
gem 'rack-test'
gem 'rake'
gem 'rdoc'
gem 'rspec'
gem 'rubyzip'
Expand All @@ -32,3 +31,4 @@ gem 'thread_safe'
gem 'tilt'
gem 'tzinfo'
gem 'uglifier'
gem 'zip'
9 changes: 7 additions & 2 deletions app/lib/migrate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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])
Expand Down
3 changes: 3 additions & 0 deletions app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dc7469

Please sign in to comment.