ocean-dynamo 1.6.0 → 1.6.1

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
  SHA256:
3
- metadata.gz: 960ad13518dfbc9b4b70fb24dbfd044b13fef403e6606a6fbf08be3599580153
4
- data.tar.gz: 022cd3afd3941e38cb541a8ecb32efeea9aee835e2a5296b0058ac91c6340b10
3
+ metadata.gz: 75ca78788e4c6fede73f78af4d7c8730e9f868198cd95f8905094f9e0032e45d
4
+ data.tar.gz: 798dc05815ecb753dcbe7062ecff1906108cde3ea498a25c53c0c4cea6588985
5
5
  SHA512:
6
- metadata.gz: a1271f9f5d677c77e6c1af17077c43ecf645c1d11bf96b543397d7c1983b614c181e15f09b403964c47e5216c073eadfe51c584e3fb908206c107e54560cdded
7
- data.tar.gz: 60464826fa2896ec5b60fae1fa3b54fc37b0f6f2585f4606dc6503693810b1cbcc22ba53532b2bdf37f46ea2e0285353595e513198aa5cf02341a49cf86915fb
6
+ metadata.gz: 99a4b8a30c990f58440f15245c90e3fd66aff7484d197a40dc48af85972bd2066858e8b4720a3273a35ee779300234e79d9ca79d21517c41f855441dc7ca2b71
7
+ data.tar.gz: 1e8df34da4547b6d00108a844b73c195ba25334866cc2f3f44016de9216ced945e67e59e20097590b19e96a2ec7fa5e439b217dd82ccb591d6c0bd414c387910
@@ -318,28 +318,39 @@ To get the highest +:expires_at+ record:
318
318
 
319
319
 
320
320
  == Installation
321
-
322
- gem install ocean-dynamo
323
-
324
- Then, locate the gem's directory and copy
325
-
326
- spec/dummy/config/initializers/aws.rb
327
-
328
- to your project's
329
-
330
- config/initializers/aws.rb
331
-
332
- Also copy
333
-
334
- spec/dummy/config/aws.yml.example
335
-
336
- to both the following locations in your project:
337
-
338
- config/aws.yml.example
339
- config/aws.yml
340
-
341
- Enter your AWS credentials in the latter file.
342
-
321
+ ```
322
+ gem install ocean-dynamo
323
+ ```
324
+
325
+ Ocean-dynamo relies on Aws.config to fetch configuration data. In Ocean, we use
326
+ an init file similar to this one:
327
+ ```
328
+ cfg = if ENV['AWS_ACCESS_KEY_ID'].present? && ENV['AWS_SECRET_ACCESS_KEY'].present?
329
+ {
330
+ region: ENV['AWS_REGION'],
331
+ credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'],
332
+ ENV['AWS_SECRET_ACCESS_KEY'])
333
+ }
334
+ elsif ENV['AWS_DYNAMODB_ENDPOINT'].present?
335
+ {
336
+ region: "eu-west-1", # Doesn't matter in this context
337
+ credentials: Aws::Credentials.new('not', 'used'),
338
+ endpoint: ENV['AWS_DYNAMODB_ENDPOINT']
339
+ }
340
+ else
341
+ {
342
+ region: ENV['AWS_REGION'],
343
+ credentials: Aws::InstanceProfileCredentials.new
344
+ }
345
+ end
346
+ Aws.config.update(cfg)
347
+ ```
348
+ As you can see, this relies on ENV variables to choose from three different
349
+ setups:
350
+ #. If you're using discrete AWS credentials, set AWS_REGION, AWS_ACCESS_KEY_ID,
351
+ and AWS_SECRET_ACCESS_KEY.
352
+ #. If you're using localstack, provide AWS_DYNAMODB_ENDPOINT (http://localhost:4569).
353
+ #. If you're using EC2 or ECS instance profile credentials, set only AWS_REGION.
343
354
 
344
355
  == Running the specs
345
356
 
@@ -1,3 +1,3 @@
1
1
  module OceanDynamo
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-dynamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson
@@ -172,7 +172,7 @@ extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
174
  - LICENSE
175
- - README.rdoc
175
+ - README.md
176
176
  - Rakefile
177
177
  - config/routes.rb
178
178
  - lib/ocean-dynamo.rb