Module: CloudFiles

Defined in:
lib/cloudfiles.rb,
lib/cloudfiles/container.rb,
lib/cloudfiles/exception.rb,
lib/cloudfiles/connection.rb,
lib/cloudfiles/authentication.rb,
lib/cloudfiles/storage_object.rb

Overview

The new properly scoped exceptions.

Defined Under Namespace

Classes: Authentication, Connection, Container, Exception, StorageObject

Constant Summary collapse

AUTH_USA =
"https://auth.api.rackspacecloud.com/v1.0"
AUTH_UK =
"https://lon.auth.api.rackspacecloud.com/v1.0"
VERSION =
IO.read(File.dirname(__FILE__) + '/../VERSION')

Class Method Summary collapse

Class Method Details

.escape(str, extra_exclude_chars = '') ⇒ Object

CGI.escape, but without special treatment on spaces



53
54
55
56
57
# File 'lib/cloudfiles.rb', line 53

def self.escape(str,extra_exclude_chars = '')
  str.gsub(/([^a-zA-Z0-9_.-#{extra_exclude_chars}]+)/) do
    '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
  end
end

.lines(str) ⇒ Object



48
49
50
# File 'lib/cloudfiles.rb', line 48

def self.lines(str)
  (str.respond_to?(:lines) ? str.lines : str).to_a.map { |x| x.chomp }
end