Skip to content

Commit

Permalink
Fixed a small bug with URI Encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Conrad Weidenkeller committed Dec 6, 2011
1 parent 2604037 commit 070a977
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG
@@ -1,5 +1,10 @@
================================================================================
1.5.0 (2011/10/31
1.5.0.1 (2011/12/05
================================================================================
o Fixed small bug with encoding or URI's

================================================================================
1.5.0 (2011/10/31)
================================================================================
o The underlying http wrapper now uses client.rb a simple abstraction to manage
each ReST call in its own function
Expand Down
3 changes: 1 addition & 2 deletions cloudfiles.gemspec
Expand Up @@ -3,7 +3,6 @@ require File.expand_path('../lib/cloudfiles/version', __FILE__)
Gem::Specification.new do |s|
s.name = %q{cloudfiles}
s.version = CloudFiles::VERSION

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["H. Wade Minter", "Rackspace Hosting"]
s.description = %q{A Ruby version of the Rackspace Cloud Files API.}
Expand Down Expand Up @@ -41,7 +40,7 @@ Gem::Specification.new do |s|
s.homepage = %q{http://www.rackspacecloud.com/cloud_hosting_products/files}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.5.0}
s.rubygems_version = %q{1.5.0.1}
s.summary = %q{A Ruby API into Rackspace Cloud Files}
s.test_files = [
"test/cf-testunit.rb",
Expand Down
7 changes: 2 additions & 5 deletions lib/cloudfiles.rb
Expand Up @@ -49,11 +49,8 @@ def self.lines(str)
(str.respond_to?(:lines) ? str.lines : str).to_a.map { |x| x.chomp }
end

# CGI.escape, but without special treatment on spaces
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
def self.escape(str)
URI.encode(str)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/cloudfiles/storage_object.rb
Expand Up @@ -400,7 +400,7 @@ def to_s # :nodoc:
end

def escape_name(name)
CloudFiles.escape name, "\/"
CloudFiles.escape name
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/cloudfiles/version.rb
@@ -1,3 +1,3 @@
module CloudFiles
VERSION = '1.5.0'
VERSION = '1.5.0.1'
end

0 comments on commit 070a977

Please sign in to comment.