Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudfiles

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudfiles

  • 1.5.0.3
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

= New projects should use {fog}[http://github.com/fog/fog].

= Rackspace Cloud Files

== Description

This is a Ruby interface into the Rackspace[http://rackspace.com/] {Cloud Files}[http://www.rackspacecloud.com/cloud_hosting_products/files] service. Cloud Files is reliable, scalable and affordable web-based storage hosting for backing up and archiving all your static content. Cloud Files is the first and only cloud service that leverages a tier one CDN provider to create such an easy and complete storage-to-delivery solution for media content.

== Upgrade Gotchas

As of gem version 1.4.8, the connection method has changed from positional arguments to a hash of options. This is the new style:

cf = CloudFiles::Connection.new(:username => "MY_USERNAME", :api_key => "MY_API_KEY")

This is the old style, which still works but is deprecated:

cf = CloudFiles::Connection.new("MY_USERNAME","MY_API_KEY")

== Installation

This source is available on Github[http://github.com/rackspace/ruby-cloudfiles/] and the gem is available on Gemcutter[http://gemcutter.org/]. To install it, do

gem sources -a http://gemcutter.org/

sudo gem install cloudfiles

To use it in a Rails application, add the following information to your config/environment.rb

config.gem "cloudfiles"

== Examples

See the class definitions for documentation on specific methods and operations.

require 'rubygems' require 'cloudfiles'

Log into the Cloud Files system

cf = CloudFiles::Connection.new(:username => "MY_USERNAME", :api_key => "MY_API_KEY")

Or, if you want to access the United Kingdom cloud installations, there's a handy constant:

cf = CloudFiles::Connection.new(:username => "MY_USERNAME", :api_key => "MY_API_KEY", :auth_url => CloudFiles::AUTH_UK)

Or, if you want to access CloudFiles from within the Rackspace network

cf = CloudFiles::Connection.new(:username => "MY_USERNAME", :api_key => "MY_API_KEY", :snet => true)

Get a listing of all containers under this account

cf.containers => ["backup", "Books", "cftest", "test", "video", "webpics"]

Access a specific container

container = cf.container('test')

See how many objects are under this container

container.count => 3

Upload a file

object = container.create_object 'filename.txt', false object.write file

List the objects

container.objects => ["bigfile.txt", "new.txt", "test.txt"]

Select an object

object = container.object('test.txt')

Get that object's data

object.data => "This is test data"

== Authors

Initial work by Major Hayden major.hayden@rackspace.com

Subsequent work by H. Wade Minter minter@lunenburg.org and Dan Prince dan.prince@rackspace.com

== License

See COPYING for license information. Copyright (c) 2011, Rackspace US, Inc.

FAQs

Package last updated on 12 Nov 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc