Class: Themigrator::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/themigrator/cli.rb

Instance Method Summary collapse

Instance Method Details

#migrateObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/themigrator/cli.rb', line 9

def migrate
  migrator = Themigrator::Migrator.new(Dir.pwd)
  pid = fork do 
	exit migrator.migrate! ? 0 : -1
  end
  Process.detach(pid)
  log_file = migrator.main_log_path(Dir.pwd, migrator.run_id)
  sleep 0.1
  Process.exec("tail --pid=#{pid} --lines=+0 --follow #{log_file}")
end

#rolesObject



21
22
23
24
25
# File 'lib/themigrator/cli.rb', line 21

def roles
  migration = Themigrator::Migration.new(Dir.pwd)
  migration.analyze_project!
  puts migration.roles.join("\n")
end