Class: TrailblazerWizard::FileHelper

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

Class Method Summary collapse

Class Method Details

.mkdir(filename) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/trailblazer_wizard/file_helper.rb', line 7

def self.mkdir(filename)
  dirs = filename.split "/"

  composite = []
  (dirs - [dirs.last]).each do |dir|
    composite << dir

    next if File.exist?(composite.join("/"))

    FileUtils.mkdir(composite.join("/"))
  end
end