Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "crack"
- require "fileutils"
- xml = Crack::XML.parse(File.read(ARGV[0]))
- def create(path)
- unless Dir.exists? path then FileUtils::mkdir_p path end
- end
- def dir(hash, prev = "./")
- hash.each do |key, value|
- if value.is_a?(Hash)
- dir(value, prev + key + "/")
- else
- create(prev + key)
- end
- end
- end
- dir(xml)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement