Class: Monolith::Generator

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Logger
Defined in:
lib/monolith/generator.rb

Instance Method Summary collapse

Methods included from Logger

#log

Constructor Details

#initialize(monolith) ⇒ Generator

Returns a new instance of Generator.



8
9
10
# File 'lib/monolith/generator.rb', line 8

def initialize(monolith)
  @monolith = monolith
end

Instance Method Details

#cloneObject



12
13
14
15
16
17
# File 'lib/monolith/generator.rb', line 12

def clone
  repositories.each do |repo|
    log("Cloning repository #{repo.name.blue}")
    repo.clone
  end
end

#generateObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/monolith/generator.rb', line 19

def generate
  clone
  fetch_all_remotes
  run_after_clone_hooks
  create_monolith
  add_remotes_to_monolith
  prepare_branches_for_merge
  merge_branches_into_monolith
  remove_remotes_from_monolith
  checkout_master_on_monolith
  run_after_generate_hooks
end