cloudfiles 1.5.0.1 → 1.5.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTM2NDk2NjY5ZWIwMDQzNzFiOWY4N2JlNDNlZGFmYTlkMzJiZDRlOQ==
5
+ data.tar.gz: !binary |-
6
+ MTZkODJjMzA4NmNkMDRlNzc4NGExYjA4MDdjNzNlNDI4MDgwNTk4Nw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZDk4MjY4OWI4ZDFlNThiN2NiMWM4MmM0OGM1N2RmZDYyMzI5MDJmZTdjYWRi
10
+ YjkwMmYxNzc1MmZiM2YyOWMwY2QzOTFhMjM2NzkzOWZhMzhlNjJkMjdkOWZm
11
+ NjhlNDNiMTAyODAyNjk0ZDQwNDdhNWE4YzEwNTFmZTNkZWJmNjA=
12
+ data.tar.gz: !binary |-
13
+ NWU4NzVmMzQ3M2M2YjA2OGQ5ODcwMjBjMDU4ODNmNzdhNjUxZGJkODRlMWZi
14
+ MTNmZWE3NzQ5OGQxODVmNDVmZmI4MmNlOWE2MGVjNjU2OGMyNWVhNDBmMmEy
15
+ Y2Y2N2JkMzlhZmFkM2E1ZDcwMGUwMmM3NjI4MmE4NjljNTg0MDU=
@@ -1,3 +1,5 @@
1
+ = New projects should use {fog}[http://github.com/fog/fog].
2
+
1
3
  = Rackspace Cloud Files
2
4
 
3
5
  == Description
@@ -40,6 +42,9 @@ See the class definitions for documentation on specific methods and operations.
40
42
  # Or, if you want to access the United Kingdom cloud installations, there's a handy constant:
41
43
  cf = CloudFiles::Connection.new(:username => "MY_USERNAME", :api_key => "MY_API_KEY", :auth_url => CloudFiles::AUTH_UK)
42
44
 
45
+ # Or, if you want to access CloudFiles from within the Rackspace network
46
+ cf = CloudFiles::Connection.new(:username => "MY_USERNAME", :api_key => "MY_API_KEY", :snet => true)
47
+
43
48
  # Get a listing of all containers under this account
44
49
  cf.containers
45
50
  => ["backup", "Books", "cftest", "test", "video", "webpics"]
@@ -7,6 +7,14 @@ Gem::Specification.new do |s|
7
7
  s.authors = ["H. Wade Minter", "Rackspace Hosting"]
8
8
  s.description = %q{A Ruby version of the Rackspace Cloud Files API.}
9
9
  s.email = %q{minter@lunenburg.org}
10
+ s.post_install_message = %Q{
11
+ **** PLEASE NOTE **********************************************************************************************
12
+
13
+ #{s.name} has been deprecated. Please consider using fog (http://github.com/fog/fog) for all new projects.
14
+
15
+ ***************************************************************************************************************
16
+
17
+ } if s.respond_to? :post_install_message
10
18
  s.extra_rdoc_files = [
11
19
  "README.rdoc",
12
20
  "TODO"
@@ -40,7 +48,7 @@ Gem::Specification.new do |s|
40
48
  s.homepage = %q{http://www.rackspacecloud.com/cloud_hosting_products/files}
41
49
  s.rdoc_options = ["--charset=UTF-8"]
42
50
  s.require_paths = ["lib"]
43
- s.rubygems_version = %q{1.5.0.1}
51
+ s.rubygems_version = %q{1.5.0.2}
44
52
  s.summary = %q{A Ruby API into Rackspace Cloud Files}
45
53
  s.test_files = [
46
54
  "test/cf-testunit.rb",
@@ -28,6 +28,7 @@ module CloudFiles
28
28
  require 'cgi'
29
29
  require 'uri'
30
30
  require 'digest/md5'
31
+ require 'date'
31
32
  require 'time'
32
33
  require 'rubygems'
33
34
 
@@ -60,17 +60,17 @@ module CloudFiles
60
60
  begin
61
61
  response = SwiftClient.head_container(self.connection.cdnurl, self.connection.authtoken, escaped_name)
62
62
  cdn_enabled = ((response["x-cdn-enabled"] || "").downcase == "true") ? true : false
63
- {
64
- :cdn_enabled => cdn_enabled,
65
- :cdn_ttl => cdn_enabled ? response["x-ttl"].to_i : nil,
66
- :cdn_url => cdn_enabled ? response["x-cdn-uri"] : nil,
67
- :cdn_ssl_url => cdn_enabled ? response["x-cdn-ssl-uri"] : nil,
68
- :cdn_streaming_url => cdn_enabled ? response["x-cdn-streaming-uri"] : nil,
69
- :cdn_log => (cdn_enabled and response["x-log-retention"] == "True") ? true : false
70
- }
71
63
  rescue ClientException => e
72
- raise CloudFiles::Exception::NoSuchContainer, "Container #{@name} does not exist" unless (e.status.to_s =~ /^20/)
64
+ cdn_enabled = false
73
65
  end
66
+ {
67
+ :cdn_enabled => cdn_enabled,
68
+ :cdn_ttl => cdn_enabled ? response["x-ttl"].to_i : nil,
69
+ :cdn_url => cdn_enabled ? response["x-cdn-uri"] : nil,
70
+ :cdn_ssl_url => cdn_enabled ? response["x-cdn-ssl-uri"] : nil,
71
+ :cdn_streaming_url => cdn_enabled ? response["x-cdn-streaming-uri"] : nil,
72
+ :cdn_log => (cdn_enabled and response["x-log-retention"] == "True") ? true : false
73
+ }
74
74
  )
75
75
  else
76
76
  @cdn_metadata = {}
@@ -17,7 +17,7 @@ module CloudFiles
17
17
  @containername = container.name
18
18
  @name = objectname
19
19
  @make_path = make_path
20
- @storagepath = "#{CloudFiles.escape @containername}/#{escaped_name}"
20
+ @storagepath = "#{CloudFiles.escape @containername}/#{@name}"
21
21
 
22
22
  if force_exists
23
23
  raise CloudFiles::Exception::NoSuchObject, "Object #{@name} does not exist" unless container.object_exists?(objectname)
@@ -35,7 +35,7 @@ module CloudFiles
35
35
  def object_metadata
36
36
  @object_metadata ||= (
37
37
  begin
38
- response = SwiftClient.head_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name)
38
+ response = SwiftClient.head_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, @name)
39
39
  rescue ClientException => e
40
40
  raise CloudFiles::Exception::NoSuchObject, "Object #{@name} does not exist" unless (e.status.to_s =~ /^20/)
41
41
  end
@@ -99,7 +99,7 @@ module CloudFiles
99
99
  headers['Range'] = range
100
100
  end
101
101
  begin
102
- response = SwiftClient.get_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name)
102
+ response = SwiftClient.get_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, @name)
103
103
  response[1]
104
104
  rescue ClientException => e
105
105
  raise CloudFiles::Exception::NoSuchObject, "Object #{@name} does not exist" unless (e.status.to_s =~ /^20/)
@@ -126,7 +126,7 @@ module CloudFiles
126
126
  headers['Range'] = range
127
127
  end
128
128
  begin
129
- SwiftClient.get_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name, nil, nil, &block)
129
+ SwiftClient.get_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, @name, nil, nil, &block)
130
130
  end
131
131
  end
132
132
 
@@ -150,7 +150,7 @@ module CloudFiles
150
150
  headers = {}
151
151
  metadatahash.each{ |key, value| headers['X-Object-Meta-' + key.to_s.capitalize] = value.to_s }
152
152
  begin
153
- SwiftClient.post_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name, headers)
153
+ SwiftClient.post_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, @name, headers)
154
154
  true
155
155
  rescue ClientException => e
156
156
  raise CloudFiles::Exception::NoSuchObject, "Object #{@name} does not exist" if (e.status.to_s == "404")
@@ -178,7 +178,7 @@ module CloudFiles
178
178
  def set_manifest(manifest)
179
179
  headers = {'X-Object-Manifest' => manifest}
180
180
  begin
181
- SwiftClient.post_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name, headers)
181
+ SwiftClient.post_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, @name, headers)
182
182
  true
183
183
  rescue ClientException => e
184
184
  raise CloudFiles::Exception::NoSuchObject, "Object #{@name} does not exist" if (response.code == "404")
@@ -221,7 +221,7 @@ module CloudFiles
221
221
  # If we're taking data from standard input, send that IO object to cfreq
222
222
  data = $stdin if (data.nil? && $stdin.tty? == false)
223
223
  begin
224
- response = SwiftClient.put_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name, data, nil, nil, nil, nil, headers)
224
+ response = SwiftClient.put_object(self.container.connection.storageurl, self.container.connection.authtoken, self.container.escaped_name, @name, data, nil, nil, nil, nil, headers)
225
225
  rescue ClientException => e
226
226
  code = e.status.to_s
227
227
  raise CloudFiles::Exception::InvalidResponse, "Invalid content-length header sent" if (code == "412")
@@ -254,7 +254,7 @@ module CloudFiles
254
254
  headers = {}
255
255
  headers = {"X-Purge-Email" => email} if email
256
256
  begin
257
- SwiftClient.delete_object(self.container.connection.cdnurl, self.container.connection.authtoken, self.container.escaped_name, escaped_name, nil, headers)
257
+ SwiftClient.delete_object(self.container.connection.cdnurl, self.container.connection.authtoken, self.container.escaped_name, @name, nil, headers)
258
258
  true
259
259
  rescue ClientException => e
260
260
  raise CloudFiles::Exception::Connection, "Error Unable to Purge Object: #{@name}" unless (e.status.to_s =~ /^20.$/)
@@ -372,15 +372,13 @@ module CloudFiles
372
372
  new_headers = options[:headers] || {}
373
373
  raise CloudFiles::Exception::Syntax, "The :headers option must be a hash" unless new_headers.is_a?(Hash)
374
374
  new_name.sub!(/^\//,'')
375
- headers = {'X-Copy-From' => "#{self.container.name}/#{self.name}", 'Content-Type' => self.content_type.sub(/;.+/, '')}.merge(new_headers)
376
- # , 'Content-Type' => self.content_type
377
- new_path = "#{CloudFiles.escape new_container}/#{escape_name new_name}"
375
+ headers = {'X-Copy-From' => "#{self.container.name}/#{CloudFiles.escape self.name}", 'Content-Type' => self.content_type.sub(/;.+/, '')}.merge(new_headers)
378
376
  begin
379
- response = SwiftClient.put_object(self.container.connection.storageurl, self.container.connection.authtoken, (CloudFiles.escape new_container), escape_name(new_name), nil, nil, nil, nil, nil, headers)
377
+ response = SwiftClient.put_object(self.container.connection.storageurl, self.container.connection.authtoken, (CloudFiles.escape new_container), new_name, nil, nil, nil, nil, nil, headers)
380
378
  return CloudFiles::Container.new(self.container.connection, new_container).object(new_name)
381
379
  rescue ClientException => e
382
380
  code = e.status.to_s
383
- raise CloudFiles::Exception::InvalidResponse, "Invalid response code #{response.code}" unless (response.code =~ /^20/)
381
+ raise CloudFiles::Exception::InvalidResponse, "Invalid response code #{code}" unless (code =~ /^20/)
384
382
  end
385
383
  end
386
384
 
@@ -1,3 +1,3 @@
1
1
  module CloudFiles
2
- VERSION = '1.5.0.1'
2
+ VERSION = '1.5.0.2'
3
3
  end
metadata CHANGED
@@ -1,65 +1,52 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cloudfiles
3
- version: !ruby/object:Gem::Version
4
- hash: 117
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 5
9
- - 0
10
- - 1
11
- version: 1.5.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.0.2
12
5
  platform: ruby
13
- authors:
6
+ authors:
14
7
  - H. Wade Minter
15
8
  - Rackspace Hosting
16
9
  autorequire:
17
10
  bindir: bin
18
11
  cert_chain: []
19
-
20
- date: 2011-12-06 00:00:00 -06:00
21
- default_executable:
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
12
+ date: 2013-05-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
24
15
  name: json
25
- prerelease: false
26
- requirement: &id001 !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- hash: 3
32
- segments:
33
- - 0
34
- version: "0"
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
35
21
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: mocha
39
22
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: mocha
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
43
32
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 43
46
- segments:
47
- - 0
48
- - 9
49
- - 8
33
+ - !ruby/object:Gem::Version
50
34
  version: 0.9.8
51
35
  type: :development
52
- version_requirements: *id002
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 0.9.8
53
42
  description: A Ruby version of the Rackspace Cloud Files API.
54
43
  email: minter@lunenburg.org
55
44
  executables: []
56
-
57
45
  extensions: []
58
-
59
- extra_rdoc_files:
46
+ extra_rdoc_files:
60
47
  - README.rdoc
61
48
  - TODO
62
- files:
49
+ files:
63
50
  - .gitignore
64
51
  - CHANGELOG
65
52
  - CONTRIBUTORS
@@ -84,41 +71,33 @@ files:
84
71
  - test/cloudfiles_storage_object_test.rb
85
72
  - test/cloudfiles_client_test.rb
86
73
  - test/test_helper.rb
87
- has_rdoc: true
88
74
  homepage: http://www.rackspacecloud.com/cloud_hosting_products/files
89
75
  licenses: []
90
-
91
- post_install_message:
92
- rdoc_options:
76
+ metadata: {}
77
+ post_install_message: ! "\n**** PLEASE NOTE **********************************************************************************************\n\n
78
+ \ cloudfiles has been deprecated. Please consider using fog (http://github.com/fog/fog)
79
+ for all new projects. \n \n***************************************************************************************************************\n\n"
80
+ rdoc_options:
93
81
  - --charset=UTF-8
94
- require_paths:
82
+ require_paths:
95
83
  - lib
96
- required_ruby_version: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
105
- required_rubygems_version: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- hash: 3
111
- segments:
112
- - 0
113
- version: "0"
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ! '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
114
94
  requirements: []
115
-
116
95
  rubyforge_project:
117
- rubygems_version: 1.3.7
96
+ rubygems_version: 2.0.3
118
97
  signing_key:
119
98
  specification_version: 3
120
99
  summary: A Ruby API into Rackspace Cloud Files
121
- test_files:
100
+ test_files:
122
101
  - test/cf-testunit.rb
123
102
  - test/cloudfiles_authentication_test.rb
124
103
  - test/cloudfiles_connection_test.rb