s3itch_client 1.2.0 → 1.2.1

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.
@@ -1,3 +1,3 @@
1
1
  module S3itchClient
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
data/lib/s3itch_client.rb CHANGED
@@ -57,8 +57,9 @@ module S3itchClient
57
57
  # Ruby 1.8.7 compatibility
58
58
  uuid = SecureRandom.respond_to?(:uuid) ? SecureRandom.uuid : SecureRandom.hex
59
59
 
60
- uniq_name = "#{basename}_#{uuid}#{extname}"
60
+ uniq_name = "#{basename}_#{uuid}"
61
61
  uniq_name = parameterize(uniq_name) if to_param
62
+ uniq_name << extname
62
63
 
63
64
  URI.encode(uniq_name)
64
65
  end
@@ -44,6 +44,14 @@ describe S3itchClient do
44
44
  end
45
45
  S3itchClient.build_unique_name("kitten", true)
46
46
  end
47
+
48
+ it "should preserve the file extension" do
49
+ name = S3itchClient.build_unique_name(kitten_path)
50
+ name.should match(/\.jpeg\z/)
51
+
52
+ name = S3itchClient.build_unique_name(kitten_path, true)
53
+ name.should match(/\.jpeg\z/)
54
+ end
47
55
  end
48
56
 
49
57
  describe ".parameterize" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3itch_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-11 00:00:00.000000000 Z
12
+ date: 2012-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  segments:
148
148
  - 0
149
- hash: 3180291602005236204
149
+ hash: -3640099612951680876
150
150
  required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  none: false
152
152
  requirements:
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  version: '0'
156
156
  segments:
157
157
  - 0
158
- hash: 3180291602005236204
158
+ hash: -3640099612951680876
159
159
  requirements: []
160
160
  rubyforge_project:
161
161
  rubygems_version: 1.8.24