paperclip-s3 1.0.0pre → 1.0.0pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/paperclip-s3.rb +14 -15
- data/lib/paperclip-s3/version.rb +1 -1
- metadata +2 -2
data/lib/paperclip-s3.rb
CHANGED
@@ -2,24 +2,23 @@ require "paperclip-s3/version"
|
|
2
2
|
|
3
3
|
module Paperclip
|
4
4
|
module S3
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
module Zinergia
|
6
|
+
# Extends the paperclips has_attached_file method
|
7
|
+
# It will use S3 Storage. The credentials will be read from the environment
|
8
|
+
def has_attached_file(name, options = {})
|
9
|
+
options[:storage] ||= :s3
|
10
|
+
options[:path] ||= "/:class-:attachment/:id/:style-:basename.:extension"
|
11
|
+
options[:bucket] ||= ENV["S3_BUCKET"]
|
12
|
+
options[:s3_credentials] ||= {
|
13
|
+
:access_key_id => ENV['S3_KEY'],
|
14
|
+
:secret_access_key => ENV['S3_SECRET']
|
15
|
+
}
|
16
|
+
super(name, options)
|
17
|
+
end
|
17
18
|
end
|
18
19
|
|
19
20
|
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
-
ActiveRecord::Base.send :extend, Paperclip::S3 if Rails.env.production?
|
25
|
-
end
|
24
|
+
ActiveRecord::Base.send :extend, Paperclip::S3::Zinergia if Rails.env.production?
|
data/lib/paperclip-s3/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: paperclip-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 5
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.0pre2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- "Nicol\xC3\xA1s Hock Isaza"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-09 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|