Class: Uas2Git::Migrator

Inherits:
Object
  • Object
show all
Defined in:
lib/uas2git/migrator.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo) ⇒ Migrator

Returns a new instance of Migrator.



6
7
8
# File 'lib/uas2git/migrator.rb', line 6

def initialize(repo)
  @repo = repo
end

Instance Method Details

#migrate!Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/uas2git/migrator.rb', line 10

def migrate!
  # Importing changesets
  @paths = {}
  @index = Rugged::Index.new

  Progress.start('Importing ' + Uas2Git::Uas::Model::AssetVersion.count.to_s + ' asset versions in ' + Uas2Git::Uas::Model::Changeset.count.to_s + ' changesets', Uas2Git::Uas::Model::AssetVersion.count * 3) do
    Uas2Git::Uas::Model::Changeset.find_each do |changeset|
      import_changeset(changeset)
    end
  end
end