kumo_dockercloud 3.4.0 → 3.5.0

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
  SHA1:
3
- metadata.gz: 08dfdf02e230230624971977dfb4b67c661b444b
4
- data.tar.gz: 5d3d3a527876ab7c443d8add610511bf45b22808
3
+ metadata.gz: 820ecad97bd162bb35d98e560b3bb2eae523a301
4
+ data.tar.gz: 95cd8aeaa7993510e356e54f6422fb0b2f886ca7
5
5
  SHA512:
6
- metadata.gz: 619c42a20c04490590d85a3ff8dcae5c09c5bdf184eb5f26ea718121efa03ee4747d520e179f811c1739ca59e669095b9b34c84f62954ee1c39feff962f22fc0
7
- data.tar.gz: 6ed1c218ea519652b5cec5da8c25a0563252ac6cab43361eceaf389f7fb8039c91594a303e9d44f3d955f3a112b6a6c122b239a3894c5672366aec04e15ab8e2
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
@@ -1,3 +1,3 @@
1
1
  module KumoDockerCloud
2
- VERSION = '3.4.0'
2
+ VERSION = '3.5.0'
3
3
  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.0
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-07 00:00:00.000000000 Z
13
+ date: 2016-06-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httpi