Skip to content

Instantly share code, notes, and snippets.

@btoone
Created April 3, 2012 03:54
Show Gist options
  • Select an option

  • Save btoone/2289166 to your computer and use it in GitHub Desktop.

Select an option

Save btoone/2289166 to your computer and use it in GitHub Desktop.
Imports a plist and exports content to files
require 'plist'
require 'active_support/inflector'
# require 'gist'
# include Inflector
r = Plist::parse_xml('snippet-export.plist')
r.each do |r|
filename = "#{r['language'].parameterize}-#{r['id']}.txt"
File.open(filename, 'w') do |f|
f.puts "#{r['body']}"
end
# Gist.new(r['body'])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment