Skip to content

Instantly share code, notes, and snippets.

@jphastings
Created May 5, 2009 14:01
Show Gist options
  • Save jphastings/106978 to your computer and use it in GitHub Desktop.
Save jphastings/106978 to your computer and use it in GitHub Desktop.
# gem install jphastings-dlc
require 'dlc'
s = DLC::Settings.new
s.name = "Your Name"
s.url = "http://yourdomain.com"
s.email = "[email protected]"
# Now you can make a dlc:
package = DLC::Package.new
package.name = "My package" # Suggested, but not required
package.comment = "like, woah" # Optional
# Add some links
package.add_link("http://google.com")
# You can pass an array
package.add_link(["http://bbc.co.uk","http://slashdot.org"])
# Add a password, if needed
package.add_password("password")
# Make the DLC
open("my_dlc.dlc","w") do |f|
f.write package.dlc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment