paperclip-aws-core 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 718454772184aea711b5a7921937f21355f73e43
4
- data.tar.gz: f5737e886600db7abab0d67ee8941ddabca856eb
3
+ metadata.gz: 180ec89f920857b42bb2aab37586b8951b784fa5
4
+ data.tar.gz: a2bbe814737e19faf96d9138c0b64f80dcc2b42e
5
5
  SHA512:
6
- metadata.gz: 77089decbafe4ecc06106fb2570345098d1d2ff243efba08dda907ff25fbdb025997049c97f77758261f1457eb534bff03a47c4525f44b901f1363caf811018d
7
- data.tar.gz: 9097e9ea7bf8104dd66e6b5ef7aede105b4b0e59944ee20d48b4c07bcc47ce60d52fce663ce2f169644ba50522d6c72ed1c7791dceee25d49f8ef06f40b35760
6
+ metadata.gz: 305efe864e9f1deac0991c2f14a7e30e23c16109ef1777c6ef367c7dab5fe9df389adf8ae3f4e374755f6f1ca9c5a1446c88f87fc62ffa04f2acd725ded04ec7
7
+ data.tar.gz: 10eebe3e5e675f39d783e34648bc04af7435dc4889455b6513db4bafebc5f5f1fe54fb7bdc1ef4a95855fda4e2ec0f97c95501c28879049acb0316034c9160d1
@@ -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::S3.new(endpoint: s3_endpoint)
105
+ instances[options] ||= s3_endpoint.present? ? ::Aws::S3.new(endpoint: s3_endpoint) : ::Aws.s3
99
106
  end
100
107
 
101
108
  def s3_endpoint
@@ -1,7 +1,7 @@
1
1
  module Paperclip
2
2
  module Aws
3
3
  module Core
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
6
6
  end
7
7
  end
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.5
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-06-30 00:00:00.000000000 Z
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