cloudfiles 1.4.4 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/cloudfiles.gemspec +7 -3
- data/lib/cloudfiles/authentication.rb +3 -3
- data/lib/cloudfiles/connection.rb +3 -3
- metadata +14 -4
data/Rakefile
CHANGED
|
@@ -9,10 +9,11 @@ begin
|
|
|
9
9
|
gemspec.email = "wade.minter@rackspace.com"
|
|
10
10
|
gemspec.homepage = "http://www.rackspacecloud.com/cloud_hosting_products/files"
|
|
11
11
|
gemspec.authors = ["H. Wade Minter", "Rackspace Hosting"]
|
|
12
|
+
gemspec.add_dependency('mime-types', '>= 1.16')
|
|
12
13
|
end
|
|
13
14
|
Jeweler::GemcutterTasks.new
|
|
14
15
|
rescue LoadError
|
|
15
|
-
puts "Jeweler not available. Install it with: sudo gem install
|
|
16
|
+
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
namespace :test do
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.4.
|
|
1
|
+
1.4.5
|
data/cloudfiles.gemspec
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{cloudfiles}
|
|
8
|
-
s.version = "1.4.
|
|
8
|
+
s.version = "1.4.5"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["H. Wade Minter", "Rackspace Hosting"]
|
|
12
|
-
s.date = %q{
|
|
12
|
+
s.date = %q{2010-02-02}
|
|
13
13
|
s.description = %q{A Ruby version of the Rackspace Cloud Files API.}
|
|
14
14
|
s.email = %q{wade.minter@rackspace.com}
|
|
15
15
|
s.extra_rdoc_files = [
|
|
16
|
-
"README.rdoc"
|
|
16
|
+
"README.rdoc",
|
|
17
|
+
"TODO"
|
|
17
18
|
]
|
|
18
19
|
s.files = [
|
|
19
20
|
".gitignore",
|
|
@@ -55,9 +56,12 @@ Gem::Specification.new do |s|
|
|
|
55
56
|
s.specification_version = 3
|
|
56
57
|
|
|
57
58
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
59
|
+
s.add_runtime_dependency(%q<mime-types>, [">= 1.16"])
|
|
58
60
|
else
|
|
61
|
+
s.add_dependency(%q<mime-types>, [">= 1.16"])
|
|
59
62
|
end
|
|
60
63
|
else
|
|
64
|
+
s.add_dependency(%q<mime-types>, [">= 1.16"])
|
|
61
65
|
end
|
|
62
66
|
end
|
|
63
67
|
|
|
@@ -10,10 +10,10 @@ module CloudFiles
|
|
|
10
10
|
#
|
|
11
11
|
# Should probably never be called directly.
|
|
12
12
|
def initialize(connection)
|
|
13
|
-
path = '/
|
|
13
|
+
path = '/v1.0'
|
|
14
14
|
hdrhash = { "X-Auth-User" => connection.authuser, "X-Auth-Key" => connection.authkey }
|
|
15
15
|
begin
|
|
16
|
-
server = Net::HTTP.new('api.
|
|
16
|
+
server = Net::HTTP.new('auth.api.rackspacecloud.com',443)
|
|
17
17
|
server.use_ssl = true
|
|
18
18
|
server.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
|
19
19
|
server.start
|
|
@@ -49,4 +49,4 @@ module CloudFiles
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
52
|
-
end
|
|
52
|
+
end
|
|
@@ -169,7 +169,7 @@ module CloudFiles
|
|
|
169
169
|
# cf.container_exists?('bad_container')
|
|
170
170
|
# => false
|
|
171
171
|
def container_exists?(containername)
|
|
172
|
-
response = cfreq("HEAD",@storagehost,"#{@storagepath}/#{containername}",@storageport,@storagescheme)
|
|
172
|
+
response = cfreq("HEAD",@storagehost,"#{@storagepath}/#{URI.encode(containername).gsub(/&/,'%26')}",@storageport,@storagescheme)
|
|
173
173
|
return (response.code == "204")? true : false ;
|
|
174
174
|
end
|
|
175
175
|
|
|
@@ -188,7 +188,7 @@ module CloudFiles
|
|
|
188
188
|
def create_container(containername)
|
|
189
189
|
raise SyntaxException, "Container name cannot contain the characters '/' or '?'" if containername.match(/[\/\?]/)
|
|
190
190
|
raise SyntaxException, "Container name is limited to 256 characters" if containername.length > 256
|
|
191
|
-
response = cfreq("PUT",@storagehost,"#{@storagepath}/#{containername}",@storageport,@storagescheme)
|
|
191
|
+
response = cfreq("PUT",@storagehost,"#{@storagepath}/#{URI.encode(containername).gsub(/&/,'%26')}",@storageport,@storagescheme)
|
|
192
192
|
raise InvalidResponseException, "Unable to create container #{containername}" unless (response.code == "201" || response.code == "202")
|
|
193
193
|
CloudFiles::Container.new(self,containername)
|
|
194
194
|
end
|
|
@@ -205,7 +205,7 @@ module CloudFiles
|
|
|
205
205
|
# cf.delete_container('nonexistent')
|
|
206
206
|
# => NoSuchContainerException: Container nonexistent does not exist
|
|
207
207
|
def delete_container(containername)
|
|
208
|
-
response = cfreq("DELETE",@storagehost,"#{@storagepath}/#{containername}",@storageport,@storagescheme)
|
|
208
|
+
response = cfreq("DELETE",@storagehost,"#{@storagepath}/#{URI.encode(containername).gsub(/&/,'%26')}",@storageport,@storagescheme)
|
|
209
209
|
raise NonEmptyContainerException, "Container #{containername} is not empty" if (response.code == "409")
|
|
210
210
|
raise NoSuchContainerException, "Container #{containername} does not exist" unless (response.code == "204")
|
|
211
211
|
true
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloudfiles
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- H. Wade Minter
|
|
@@ -10,10 +10,19 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date:
|
|
13
|
+
date: 2010-02-02 00:00:00 -06:00
|
|
14
14
|
default_executable:
|
|
15
|
-
dependencies:
|
|
16
|
-
|
|
15
|
+
dependencies:
|
|
16
|
+
- !ruby/object:Gem::Dependency
|
|
17
|
+
name: mime-types
|
|
18
|
+
type: :runtime
|
|
19
|
+
version_requirement:
|
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
21
|
+
requirements:
|
|
22
|
+
- - ">="
|
|
23
|
+
- !ruby/object:Gem::Version
|
|
24
|
+
version: "1.16"
|
|
25
|
+
version:
|
|
17
26
|
description: A Ruby version of the Rackspace Cloud Files API.
|
|
18
27
|
email: wade.minter@rackspace.com
|
|
19
28
|
executables: []
|
|
@@ -22,6 +31,7 @@ extensions: []
|
|
|
22
31
|
|
|
23
32
|
extra_rdoc_files:
|
|
24
33
|
- README.rdoc
|
|
34
|
+
- TODO
|
|
25
35
|
files:
|
|
26
36
|
- .gitignore
|
|
27
37
|
- COPYING
|