exel-s3 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4a51332e89651de73f2713f7cdb409c91290199
4
- data.tar.gz: 60e49619e30c0cf1997aff639cf7fa3c81f45011
3
+ metadata.gz: 3879907f2ecda96df921df309cb7a3d3d60bc924
4
+ data.tar.gz: a0f2d39d90dce1de2c2786aef502e2e59baea89d
5
5
  SHA512:
6
- metadata.gz: fc119e9472e9e3d51f154acd0ad85c4c378fc999aae10fcf356f81856747e65c53c36365605eae46dea82678c66c0b85ecced8b560baa1ceebab6f8516305f5d
7
- data.tar.gz: 2ad70a38198db0c9225ec6ebeca69437f13de25625bda08847bf4d3b921f281f1b938ed522b0ca73f2e2907ce64705a916ff09d3aaec4e1f121475d8f04efa23
6
+ metadata.gz: 723fe2ba34d3edd5fc7db06321f75f0aba957aac1d4a8cafb8c25a87b73a73a50c08f98ac918cc64b4a5aeee4e10db3c2c6175211b3013526eedae7687439519
7
+ data.tar.gz: 1f9fa6cacf3012f7876dcbe135189d7cb828e2a2541efe9c703c638e5a61fe4754e99f226a204e9393270aa582866da8d87434686001141ab46d7de5c4bb0333
data/README.md CHANGED
@@ -34,6 +34,7 @@ The following configuration must be provided:
34
34
  )
35
35
 
36
36
  config.s3_bucket = 'the name of the bucket to use'
37
+ config.s3_region = 'us-east-1' # default
37
38
  end
38
39
 
39
40
  ## Contributing
@@ -29,7 +29,7 @@ module EXEL
29
29
  EXEL.configuration.aws.access_key_id,
30
30
  EXEL.configuration.aws.secret_access_key
31
31
  ),
32
- region: 'us-east-1'
32
+ region: EXEL.configuration.s3_region || 'us-east-1'
33
33
  )
34
34
  s3.bucket(EXEL.configuration.s3_bucket).object(filename)
35
35
  end
@@ -1,5 +1,5 @@
1
1
  module EXEL
2
2
  module S3
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.0.2'.freeze
4
4
  end
5
5
  end
@@ -5,6 +5,7 @@ module EXEL
5
5
  EXEL.configure do |config|
6
6
  config.aws = OpenStruct.new
7
7
  config.s3_bucket = 'bucket'
8
+ config.s3_region = 's3-region'
8
9
  end
9
10
  end
10
11
 
@@ -15,6 +16,17 @@ module EXEL
15
16
  expect(s3_obj.bucket_name).to eq('bucket')
16
17
  expect(s3_obj.key).to eq(file_name)
17
18
  end
19
+
20
+ it 'uses the configured s3 region' do
21
+ expect(Aws::S3::Resource).to receive(:new).with(hash_including(region: 's3-region')).and_call_original
22
+ subject.get_object('foo.txt')
23
+ end
24
+
25
+ it 'defaults the s3 region to us-east-1' do
26
+ allow(EXEL.configuration).to receive(:s3_region).and_return(nil)
27
+ expect(Aws::S3::Resource).to receive(:new).with(hash_including(region: 'us-east-1')).and_call_original
28
+ subject.get_object('foo.txt')
29
+ end
18
30
  end
19
31
 
20
32
  describe '#upload' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exel-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yroo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-15 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: exel