Skip to content

Instantly share code, notes, and snippets.

@ykhrustalev
Created September 5, 2016 20:31
Show Gist options
  • Save ykhrustalev/f2c4d506e0099765dd7e26f1cb7a60da to your computer and use it in GitHub Desktop.
Save ykhrustalev/f2c4d506e0099765dd7e26f1cb7a60da to your computer and use it in GitHub Desktop.
def makedirs(path)
cur_path = ''
path.split('/').each do |sub_directory|
cur_path = "#{cur_path}/#{sub_directory}"
Dir.mkdir(cur_path) unless File.directory?(cur_path)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment