paperclip-aws-core 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paperclip/aws/core.rb +9 -2
- data/lib/paperclip/aws/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 180ec89f920857b42bb2aab37586b8951b784fa5
|
4
|
+
data.tar.gz: a2bbe814737e19faf96d9138c0b64f80dcc2b42e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 305efe864e9f1deac0991c2f14a7e30e23c16109ef1777c6ef367c7dab5fe9df389adf8ae3f4e374755f6f1ca9c5a1446c88f87fc62ffa04f2acd725ded04ec7
|
7
|
+
data.tar.gz: 10eebe3e5e675f39d783e34648bc04af7435dc4889455b6513db4bafebc5f5f1fe54fb7bdc1ef4a95855fda4e2ec0f97c95501c28879049acb0316034c9160d1
|
data/lib/paperclip/aws/core.rb
CHANGED
@@ -16,7 +16,14 @@ module Paperclip
|
|
16
16
|
@s3_options = @options[:s3_options] || {}
|
17
17
|
|
18
18
|
@s3_endpoint = @options[:s3_endpoint]
|
19
|
-
|
19
|
+
|
20
|
+
if @options[:credentials].present?
|
21
|
+
credentials = @options[:credentials].symbolize_keys
|
22
|
+
::Aws::config[:credentials] = ::Aws::Credentials.new(credentials[:access_key_id], credentials[:secret_access_key])
|
23
|
+
::Aws.config[:region] = credentials[:region]
|
24
|
+
end
|
25
|
+
|
26
|
+
@aws_credentials = @options[:credentials] || {}
|
20
27
|
|
21
28
|
@s3_protocol = @options[:s3_protocol] ||
|
22
29
|
Proc.new do |style, attachment|
|
@@ -95,7 +102,7 @@ module Paperclip
|
|
95
102
|
|
96
103
|
def obtain_s3_instance_for(options)
|
97
104
|
instances = (Thread.current[:paperclip_s3_instances] ||= {})
|
98
|
-
instances[options] ||= s3_endpoint.present? ? ::Aws::S3.new(endpoint: s3_endpoint) : ::Aws
|
105
|
+
instances[options] ||= s3_endpoint.present? ? ::Aws::S3.new(endpoint: s3_endpoint) : ::Aws.s3
|
99
106
|
end
|
100
107
|
|
101
108
|
def s3_endpoint
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-aws-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Centinaro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|