twm_paperclip 2.3.6b → 2.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/paperclip/storage/s3.rb +13 -20
- data/lib/paperclip/version.rb +1 -1
- metadata +8 -10
data/lib/paperclip/storage/s3.rb
CHANGED
@@ -94,8 +94,8 @@ module Paperclip
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
def expiring_url(time = 3600
|
98
|
-
AWS::S3::S3Object.url_for(path
|
97
|
+
def expiring_url(time = 3600)
|
98
|
+
AWS::S3::S3Object.url_for(path, bucket_name, :expires_in => time )
|
99
99
|
end
|
100
100
|
|
101
101
|
def bucket_name
|
@@ -147,28 +147,21 @@ module Paperclip
|
|
147
147
|
log("saving #{path(style)}")
|
148
148
|
# Nasty hack, thumbnails for PDFs generated in jpg/png/gif are NOT the content_type of the original file!
|
149
149
|
# Override the content_type based on these extensions.
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
when /.gif$/
|
160
|
-
"image/gif"
|
161
|
-
access = :public_read
|
162
|
-
else
|
163
|
-
instance_read(:content_type)
|
164
|
-
end
|
150
|
+
content_type = case(file.path)
|
151
|
+
when /.jpg$/
|
152
|
+
"image/jpeg"
|
153
|
+
when /.png$/
|
154
|
+
"image/png"
|
155
|
+
when /.gif$/
|
156
|
+
"image/gif"
|
157
|
+
else
|
158
|
+
instance_read(:content_type)
|
165
159
|
end
|
166
160
|
AWS::S3::S3Object.store(path(style),
|
167
161
|
file,
|
168
162
|
bucket_name,
|
169
|
-
{
|
170
|
-
|
171
|
-
:access => access,
|
163
|
+
{:content_type => content_type,#instance_read(:content_type),
|
164
|
+
:access => @s3_permissions,
|
172
165
|
}.merge(@s3_headers))
|
173
166
|
rescue AWS::S3::NoSuchBucket => e
|
174
167
|
create_bucket
|
data/lib/paperclip/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twm_paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 2.3.
|
9
|
+
- 6
|
10
|
+
version: 2.3.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jon Yurek
|
@@ -206,14 +206,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
206
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|
209
|
-
- - "
|
209
|
+
- - ">="
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
hash:
|
211
|
+
hash: 3
|
212
212
|
segments:
|
213
|
-
-
|
214
|
-
|
215
|
-
- 1
|
216
|
-
version: 1.3.1
|
213
|
+
- 0
|
214
|
+
version: "0"
|
217
215
|
requirements:
|
218
216
|
- ImageMagick
|
219
217
|
rubyforge_project: paperclip
|