1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Used idempotent from new excon for s3. Version bump to 0.0.32

This commit is contained in:
Wesley Beary 2009-12-03 21:39:04 -08:00
parent 66c0bd3e51
commit bae0ef8ec2
7 changed files with 61 additions and 25 deletions

View file

@ -7,7 +7,7 @@ require "#{current_directory}/lib/fog"
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.add_dependency('excon')
gem.add_dependency('excon', '>=0.0.10')
gem.add_dependency('mime-types')
gem.add_dependency('nokogiri')
gem.add_dependency('ruby-hmac')

View file

@ -1 +1 @@
0.0.31
0.0.32

View file

@ -1,15 +1,15 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{fog}
s.version = "0.0.31"
s.version = "0.0.32"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["geemus (Wesley Beary)"]
s.date = %q{2009-11-21}
s.date = %q{2009-12-03}
s.default_executable = %q{fog}
s.description = %q{brings clouds to you}
s.email = %q{me@geemus.com}
@ -166,6 +166,18 @@ Gem::Specification.new do |s|
"lib/fog/rackspace/requests/servers/reboot_server.rb",
"lib/fog/rackspace/requests/servers/update_server.rb",
"lib/fog/rackspace/servers.rb",
"lib/fog/slicehost.rb",
"lib/fog/slicehost/parsers/create_slice.rb",
"lib/fog/slicehost/parsers/get_backups.rb",
"lib/fog/slicehost/parsers/get_flavors.rb",
"lib/fog/slicehost/parsers/get_images.rb",
"lib/fog/slicehost/parsers/get_slices.rb",
"lib/fog/slicehost/requests/create_slice.rb",
"lib/fog/slicehost/requests/delete_slice.rb",
"lib/fog/slicehost/requests/get_backups.rb",
"lib/fog/slicehost/requests/get_flavors.rb",
"lib/fog/slicehost/requests/get_images.rb",
"lib/fog/slicehost/requests/get_slices.rb",
"spec/aws/models/ec2/address_spec.rb",
"spec/aws/models/ec2/addresses_spec.rb",
"spec/aws/models/ec2/instance_spec.rb",
@ -259,6 +271,12 @@ Gem::Specification.new do |s|
"spec/rackspace/requests/servers/list_servers_spec.rb",
"spec/rackspace/requests/servers/reboot_server_spec.rb",
"spec/rackspace/requests/servers/update_server_spec.rb",
"spec/slicehost/requests/create_slice_spec.rb",
"spec/slicehost/requests/delete_slice_spec.rb",
"spec/slicehost/requests/get_backups_spec.rb",
"spec/slicehost/requests/get_flavors_spec.rb",
"spec/slicehost/requests/get_images_spec.rb",
"spec/slicehost/requests/get_slices_spec.rb",
"spec/spec.opts",
"spec/spec_helper.rb"
]
@ -361,6 +379,12 @@ Gem::Specification.new do |s|
"spec/rackspace/requests/servers/list_servers_spec.rb",
"spec/rackspace/requests/servers/reboot_server_spec.rb",
"spec/rackspace/requests/servers/update_server_spec.rb",
"spec/slicehost/requests/create_slice_spec.rb",
"spec/slicehost/requests/delete_slice_spec.rb",
"spec/slicehost/requests/get_backups_spec.rb",
"spec/slicehost/requests/get_flavors_spec.rb",
"spec/slicehost/requests/get_images_spec.rb",
"spec/slicehost/requests/get_slices_spec.rb",
"spec/spec_helper.rb"
]
@ -369,20 +393,21 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<excon>, [">= 0"])
s.add_runtime_dependency(%q<excon>, [">= 0.0.10"])
s.add_runtime_dependency(%q<mime-types>, [">= 0"])
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0"])
else
s.add_dependency(%q<excon>, [">= 0"])
s.add_dependency(%q<excon>, [">= 0.0.10"])
s.add_dependency(%q<mime-types>, [">= 0"])
s.add_dependency(%q<nokogiri>, [">= 0"])
s.add_dependency(%q<ruby-hmac>, [">= 0"])
end
else
s.add_dependency(%q<excon>, [">= 0"])
s.add_dependency(%q<excon>, [">= 0.0.10"])
s.add_dependency(%q<mime-types>, [">= 0"])
s.add_dependency(%q<nokogiri>, [">= 0"])
s.add_dependency(%q<ruby-hmac>, [">= 0"])
end
end

View file

@ -15,11 +15,12 @@ unless Fog.mocking?
# * status<~Integer> - 204
def delete_object(bucket_name, object_name)
request({
:expects => 204,
:headers => {},
:host => "#{bucket_name}.#{@host}",
:method => 'DELETE',
:path => CGI.escape(object_name)
:expects => 204,
:headers => {},
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'DELETE',
:path => CGI.escape(object_name)
})
end

View file

@ -26,11 +26,12 @@ unless Fog.mocking?
data = nil
end
request({
:expects => 200,
:body => data,
:headers => {},
:host => "#{bucket_name}.#{@host}",
:method => 'PUT'
:expects => 200,
:body => data,
:headers => {},
:idempotent => true,
:host => "#{bucket_name}.#{@host}",
:method => 'PUT'
})
end

View file

@ -28,12 +28,13 @@ unless Fog.mocking?
data = parse_data(data)
headers = data[:headers].merge!(options)
request({
:body => data[:body],
:expects => 200,
:headers => headers,
:host => "#{bucket_name}.#{@host}",
:method => 'PUT',
:path => CGI.escape(object_name)
:body => data[:body],
:expects => 200,
:headers => headers,
:host => "#{bucket_name}.#{@host}",
:idempotent => true,
:method => 'PUT',
:path => CGI.escape(object_name)
})
end

View file

@ -31,5 +31,13 @@ describe 'S3.put_object' do
}.should raise_error(Excon::Errors::NotFound)
end
it 'should not raise an error if the object already exists' do
s3.put_bucket('fogputobject')
s3.put_object('fogputobject', 'fog_put_object', lorem_file)
s3.put_object('fogputobject', 'fog_put_object', lorem_file)
s3.delete_object('fogputobject', 'fog_put_object')
s3.delete_bucket('fogputobject')
end
end
end