Skip to content

Instantly share code, notes, and snippets.

@lamdor
Created August 27, 2009 20:49
Show Gist options
  • Select an option

  • Save lamdor/176554 to your computer and use it in GitHub Desktop.

Select an option

Save lamdor/176554 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby -w
require 'rubygems'
require 'builder'
builder = Builder::XmlMarkup.new(:target => $stdout, :indent => 2)
builder.instruct! :xml, :version => '1.0', :encoding => "UTF-8"
builder.declare! :DOCTYPE, :plist, :PUBLIC, "-//Apple//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
builder.plist :version => "1.0" do |p|
p.dict do |d|
ENV.each do |key, value|
d.key key
d.string value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment