Created
September 2, 2009 16:29
-
-
Save tekwiz/179808 to your computer and use it in GitHub Desktop.
Ruby Snippets for CloudFiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'cloudfiles' | |
require 'activesupport' | |
CF_USERNAME = '' | |
CF_API_KEY = '' | |
CONTAINER = '' | |
# Connect | |
cf = CloudFiles::Connection.new(CF_USERNAME, CF_API_KEY) | |
# List All Containers | |
puts "CF Containers" | |
cf.containers.each {|c| puts " * #{c}"} | |
# List All Objects in a Container | |
puts "CF #{CONTAINER}" | |
c = cf.container(CONTAINER) | |
c.objects.each {|o| puts " * #{o}"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment