Skip to content

Instantly share code, notes, and snippets.

@JamesMaroney
Created June 1, 2012 06:18
Show Gist options
  • Save JamesMaroney/2849486 to your computer and use it in GitHub Desktop.
Save JamesMaroney/2849486 to your computer and use it in GitHub Desktop.
task :default do
source = File.open('source.xml').read
source.scan(/id="(.*?)".*?d="(.*?)"/m) do |m|
puts "id: #{m[0]}, path: #{m[1]}"
File.open("#{m[0]}.svg", "w+") do |out|
out.write '<svg>'
out.write "<path d=\"#{}\""
out.write '</svg>'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment