Class: GenGITStructure

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

Instance Method Summary collapse

Instance Method Details

#makeDirTree(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/genGITstructure.rb', line 6

def makeDirTree(*args)
  output = args[0]
  org = args[1]
  productNames = args[2]

  dir = ""
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','brands'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','libraries'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','libraries','coverages'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','libraries','entities'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','libraries','genericlayoutgrids'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','libraries','genericlayoutgrids','stylesheets'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','libraries','lists'))
  Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','products'))

  productNames.each do |p|
    Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','products',"#{p}"))
    Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','products',"#{p}",'DSL'))
    Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','products',"#{p}",'DSL','coverages'))
    Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','products',"#{p}",'DSL','entities'))
    Dir.mkdir(dir) if !File.exist?(dir = File.join(output, org,'git','products',"#{p}",'DSL','layouts'))
  end
end