ocean-rails 2.4.1 → 2.4.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: a7b5a78372d3c35068c061e3004599974cc799b8
4
- data.tar.gz: 43d486b1440b968dddcc88d143cd4ed6f0c6da15
3
+ metadata.gz: 9d4700f58e4efcefda8d03924a2f00d42767ca1b
4
+ data.tar.gz: 6e471c7095d2471839111c092ecbd0d1656597e4
5
5
  SHA512:
6
- metadata.gz: 63ae97e72021e9040ea979d7204e0ea6f3b02d3cf17e279207cc3b4b27f3d688eba591f6dd4fd02709871fd4b46a852197a017f2e677dc603910671604e12da9
7
- data.tar.gz: e038b3a1d74d55c715485baa14cdd7b8cdf328603d74af85a5fffdaedf3f2dffbfa1a526e340fad59aec7ef8d98496c192be687186142ed4689b3c60f238f142
6
+ metadata.gz: cb3406dd08bc094045841d5bde5bed442c233b0468834ea335c9075ac5fd02e36eec531ec2ca7d9a55428b59f9654e32724df731f68a7349a9c4f497c8694c59
7
+ data.tar.gz: 0354d7eac1d60908a00ce514aa0dd6c3fe0c9376f046c3252347569dbef6ebb0d2778421e569d889a788fb462daaef7464d33b135fdf232442e58d07393609de
@@ -1,35 +1,45 @@
1
- # The is the example file
2
- ef = File.join(Rails.root, "config/aws.yml.example")
1
+ # Check if the ENV vars are set; if so, don't read any file
2
+ if (ENV['AWS_ACCESS_KEY_ID'].present? &&
3
+ ENV['AWS_SECRET_ACCESS_KEY'].present? &&
4
+ ENV['AWS_REGION'].present?)
5
+ AWS.config if defined? AWS
6
+ Aws.config if defined? Aws
7
+ else
3
8
 
4
- # Only load AWS data if there is an example file
5
- if File.exists?(ef)
9
+ # The is the example file
10
+ ef = File.join(Rails.root, "config/aws.yml.example")
6
11
 
7
- # This is the tailored file, not under source control.
8
- f = File.join(Rails.root, "config/aws.yml")
9
-
10
- # If the tailored file doesn't exist, and we're running in test mode
11
- # (which is the case under TeamCity), use the example file as-is.
12
- unless File.exists?(f)
13
- f = ENV['OCEAN_API_HOST'] ? ef : false
14
- end
12
+ # Only load AWS data if there is an example file
13
+ if File.exists?(ef)
15
14
 
16
- # If there is a file to process, do so
17
- if f
18
- options = YAML.load(File.read(f))[Rails.env]
19
- AWS.config options if defined? AWS
20
- Aws.config = options if defined? Aws
21
- else
22
- # Otherwise print an error message and abort.
23
- puts
24
- puts "-----------------------------------------------------------------------"
25
- puts "AWS config file missing. Please copy config/aws.yml.example"
26
- puts "to config/aws.yml and tailor its contents to suit your dev setup."
27
- puts
28
- puts "NB: aws.yml is excluded from git version control as it will contain"
29
- puts " data private to your Ocean system."
30
- puts "-----------------------------------------------------------------------"
31
- puts
32
- abort
33
- end
15
+ # This is the tailored file, not under source control.
16
+ f = File.join(Rails.root, "config/aws.yml")
17
+
18
+ # If the tailored file doesn't exist, and we're running in test mode
19
+ # (which is the case under TeamCity), use the example file as-is.
20
+ unless File.exists?(f)
21
+ f = ENV['OCEAN_API_HOST'] ? ef : false
22
+ end
34
23
 
24
+ # If there is a file to process, do so
25
+ if f
26
+ options = YAML.load(File.read(f))[Rails.env]
27
+ AWS.config options if defined? AWS
28
+ Aws.config = options if defined? Aws
29
+ else
30
+ # Otherwise print an error message and abort.
31
+ puts
32
+ puts "-----------------------------------------------------------------------"
33
+ puts "AWS config file missing. Please copy config/aws.yml.example"
34
+ puts "to config/aws.yml and tailor its contents to suit your dev setup."
35
+ puts "Alternatively export environment variables AWS_ACCESS_KEY_ID,"
36
+ puts "AWS_SECRET_ACCESS_KEY, and AWS_REGION."
37
+ puts
38
+ puts "NB: aws.yml is excluded from git version control as it will contain"
39
+ puts " data private to your Ocean system."
40
+ puts "-----------------------------------------------------------------------"
41
+ puts
42
+ abort
43
+ end
44
+ end
35
45
  end
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "2.4.1"
2
+ VERSION = "2.4.2"
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: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson