kumo_dockercloud 3.4.0 → 3.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 820ecad97bd162bb35d98e560b3bb2eae523a301
|
4
|
+
data.tar.gz: 95cd8aeaa7993510e356e54f6422fb0b2f886ca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30e761f350ea5ea458116817c04e81dcac90e50a9664c0b27478f44628d14f7fe83f86eadda156b06e54958597746d79d9be80d1ea6ae531b548661050aa3a4c
|
7
|
+
data.tar.gz: 1ff27486cbbca56f28c1f77196d1b68331a57291dcf30820210ced8bf70f368dc884ff181536b22e56b0fee29bcfab4e079c920b6f6a55acde17bea301cd3f86
|
@@ -64,6 +64,14 @@ module KumoDockerCloud
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
def config
|
68
|
+
return @config if @config
|
69
|
+
|
70
|
+
file = File.read(config_file_path)
|
71
|
+
erb_result = ERB.new(file).result(get_binding)
|
72
|
+
@config = YAML.load(erb_result)
|
73
|
+
end
|
74
|
+
|
67
75
|
def plain_text_secrets
|
68
76
|
@plain_text_secrets ||= Hash[
|
69
77
|
encrypted_secrets.map do |name, cipher_text|
|
@@ -109,13 +117,22 @@ module KumoDockerCloud
|
|
109
117
|
@kms ||= KumoKi::KMS.new
|
110
118
|
end
|
111
119
|
|
120
|
+
def config_file_path
|
121
|
+
path = File.join(config_path, "#{env_name}.yml")
|
122
|
+
path = File.join(config_path, "development.yml") unless File.exist?(path)
|
123
|
+
path
|
124
|
+
end
|
125
|
+
|
112
126
|
def encrypted_secrets_path
|
113
|
-
config_path = File.expand_path(File.join(@config_path), __FILE__)
|
114
127
|
secrets_filepath = File.join(config_path, "#{env_name}_secrets.yml")
|
115
128
|
secrets_filepath = File.join(config_path, 'development_secrets.yml') unless File.exist?(secrets_filepath)
|
116
129
|
secrets_filepath
|
117
130
|
end
|
118
131
|
|
132
|
+
def config_path
|
133
|
+
File.expand_path(File.join(@config_path), __FILE__)
|
134
|
+
end
|
135
|
+
|
119
136
|
def encrypted_secrets_filename
|
120
137
|
File.basename encrypted_secrets_path
|
121
138
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
foo: bar
|
@@ -23,6 +23,14 @@ describe KumoDockerCloud::EnvironmentConfig do
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
describe '#config' do
|
27
|
+
subject { instance.config }
|
28
|
+
|
29
|
+
it "has the correct data" do
|
30
|
+
expect(subject['foo']).to eq 'bar'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
26
34
|
describe '#plain_text_secrets' do
|
27
35
|
subject { instance.plain_text_secrets }
|
28
36
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumo_dockercloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Redbubble
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-06-
|
13
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httpi
|