ocean-rails 7.2.0 → 7.2.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: 9e310755cb9f8ae50faa37a527bb9fcf60114cf14dddd3e65ed7c409d3916abc
4
- data.tar.gz: 7f50f5b0cc5c5ae1bb636fee39df5106ef176a0a7ca2e1165a9b8013b8fc259f
3
+ metadata.gz: acf56cf8bce9166dcc5a120e197bbdcd615f5c79baec5c99fe9b672fc07f1852
4
+ data.tar.gz: 27f9e22eab32031c503ac330fbe664c2e2fefd6bf9f3c235889a47a5442d1b10
5
5
  SHA512:
6
- metadata.gz: ca3905a22de0b28182622dde001ecaaf1b1e062ed6fb1e2e8db08696505d69907e4112ef1930644af3079d29e588ac154323057b2db91df00837d18359296a61
7
- data.tar.gz: c8d5df2e30cab29673d663fc6b591165c359750d9b1e11801b8d43a7af426c3626e418e32bb12d8d4ae1502001311dcd09b7ea04c82102aa0cbfb76d64270bf8
6
+ metadata.gz: 95889ce4e8ebb8aaf40c42f868e0c219a29617e17ccd2433f440cb137ee0df6b5a2fef9e84058322028479fe306388be394638a6f10ac4d1caa9573d10adffa0
7
+ data.tar.gz: a3a08fc01c54b7a59391329f02cc641f0bb2454aa70310bddba99a59bef7a27931ae1d5e37c2143a777b726b1cf1037b83f3bcd3f4c9260d02b5cd1d9d0a59f2
@@ -4,53 +4,32 @@ if (ENV['AWS_ACCESS_KEY_ID'].present? &&
4
4
  ENV['AWS_REGION'].present?)
5
5
  Aws.config
6
6
  else
7
-
8
- # The is the example file
9
- ef = File.join(Rails.root, "config/aws.yml.example")
10
-
11
- # Only load AWS data if there is an example file
12
- if File.exists?(ef)
13
-
14
- # This is the tailored file, not under source control.
15
- f = File.join(Rails.root, "config/aws.yml")
16
-
17
- # If the tailored file doesn't exist, and we're running in test mode
18
- # (which is the case under TeamCity), use the example file as-is.
19
- unless File.exists?(f)
20
- f = ENV['OCEAN_API_HOST'] ? ef : false
21
- end
22
-
23
- # If there is a file to process, do so
24
- if f
25
- template = ERB.new(File.read(f))
26
- processed = YAML.load(template.result(binding))
27
- cfg = processed[Rails.env]
28
- # Set the ENV variables
29
- ENV['AWS_ACCESS_KEY_ID'] = cfg[:access_key_id] || cfg['access_key_id']
30
- ENV['AWS_SECRET_ACCESS_KEY'] = cfg[:secret_access_key] || cfg['secret_access_key']
31
- ENV['AWS_REGION'] ||= cfg[:region] || cfg['region']
32
- # Configure AWS with the raw cfg data
33
- AWS.config(cfg)
34
- # Configure Aws with a massaged version of the cfg data
35
- config = { region: ENV['AWS_REGION'],
36
- credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
37
- }
38
- config[:endpoint] = cfg["endpoint"] if cfg["endpoint"]
39
- Aws.config.update(config)
40
- else
41
- # Otherwise print an error message and exit with an error.
42
- puts
43
- puts "-----------------------------------------------------------------------"
44
- puts "AWS config file missing. Please copy config/aws.yml.example"
45
- puts "to config/aws.yml and tailor its contents to suit your dev setup."
46
- puts "Alternatively export environment variables AWS_ACCESS_KEY_ID,"
47
- puts "AWS_SECRET_ACCESS_KEY, and AWS_REGION."
48
- puts
49
- puts "NB: aws.yml is excluded from git version control as it will contain"
50
- puts " data private to your Ocean system."
51
- puts "-----------------------------------------------------------------------"
52
- puts
53
- exit 1
54
- end
7
+ f = File.join(Rails.root, "config/aws.yml")
8
+ if f
9
+ template = ERB.new(File.read(f))
10
+ processed = YAML.load(template.result(binding))
11
+ cfg = processed[Rails.env]
12
+ # Set the ENV variables
13
+ ENV['AWS_ACCESS_KEY_ID'] = cfg[:access_key_id] || cfg['access_key_id']
14
+ ENV['AWS_SECRET_ACCESS_KEY'] = cfg[:secret_access_key] || cfg['secret_access_key']
15
+ ENV['AWS_REGION'] ||= cfg[:region] || cfg['region']
16
+ # Configure AWS with the raw cfg data
17
+ AWS.config(cfg)
18
+ # Configure Aws with a massaged version of the cfg data
19
+ config = { region: ENV['AWS_REGION'],
20
+ credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
21
+ }
22
+ config[:endpoint] = cfg["endpoint"] if cfg["endpoint"]
23
+ Aws.config.update(config)
24
+ else
25
+ # Otherwise print an error message and exit with an error.
26
+ puts
27
+ puts "-----------------------------------------------------------------------"
28
+ puts "AWS config file missing. Please copy config/aws.yml from the ocean-rails"
29
+ puts "gem. Alternatively export environment variables AWS_ACCESS_KEY_ID,"
30
+ puts "AWS_SECRET_ACCESS_KEY, and AWS_REGION."
31
+ puts "-----------------------------------------------------------------------"
32
+ puts
33
+ exit 1
55
34
  end
56
35
  end
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "7.2.0"
2
+ VERSION = "7.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.0
4
+ version: 7.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson