Created
September 5, 2016 20:31
-
-
Save ykhrustalev/f2c4d506e0099765dd7e26f1cb7a60da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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