berkeley_library-docker 0.1.0 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75df4187f362680f782f8ce0e4d7a5aa438c4f86f44d1337c0495253e1b4733a
|
4
|
+
data.tar.gz: 51fdf2f4e9f29080bda4d7fe93096c0d314def1649f6a7da70290324ca7f642a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24714d86ebb5416d303acca6d31f46e1d3e4c7514afbf2fcee166638c7ba25c64cbc5e1d4fdbc49e97babc5568198d32c09909ab1bc43c0652c56a3140a9ff98
|
7
|
+
data.tar.gz: 31b41f95fe42a25a725c9d8702d00e4a922c41afb8df1b9503ed3efab626a206511ffbe69e925c8d26a0c6779afbb977c4427c4c81ced59e4edb1273c9baced2
|
@@ -7,7 +7,7 @@ module BerkeleyLibrary
|
|
7
7
|
SUMMARY = 'Utility functions for Dockerizing Ruby apps'.freeze
|
8
8
|
DESCRIPTION = 'Utility functions for making Ruby apps "just work" in Docker containers.'.freeze
|
9
9
|
LICENSE = 'MIT'.freeze
|
10
|
-
VERSION = '0.1.
|
10
|
+
VERSION = '0.1.1'.freeze
|
11
11
|
HOMEPAGE = 'https://github.com/BerkeleyLibrary/docker'.freeze
|
12
12
|
|
13
13
|
private_class_method :new
|
@@ -3,7 +3,9 @@ require 'berkeley_library/docker/secret'
|
|
3
3
|
module BerkeleyLibrary
|
4
4
|
module Docker
|
5
5
|
class Railtie < Rails::Railtie
|
6
|
-
|
6
|
+
NAME = 'berkeley_library-docker.load_secrets'.freeze
|
7
|
+
|
8
|
+
initializer(NAME, after: :initialize_logger) { Secret.load_secrets! }
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
@@ -5,18 +5,33 @@ require 'spec_helper'
|
|
5
5
|
module BerkeleyLibrary
|
6
6
|
module Docker
|
7
7
|
describe Railtie do
|
8
|
-
|
9
|
-
|
8
|
+
class TestApp < Rails::Application; end
|
9
|
+
|
10
|
+
let(:app) { TestApp.create }
|
11
|
+
let(:initializers) { app.initializers.tsort_each.collect(&:name) }
|
12
|
+
let(:railtie_name) { BerkeleyLibrary::Docker::Railtie::NAME }
|
13
|
+
|
14
|
+
it 'has the expected initializer name' do
|
15
|
+
expect(railtie_name).to eq 'berkeley_library-docker.load_secrets'
|
10
16
|
end
|
11
17
|
|
12
18
|
it 'causes rails to load the environment' do
|
13
19
|
with_secret('API_TOKEN', 'd33db55f') do
|
14
|
-
|
15
|
-
|
20
|
+
app = TestApp.create
|
21
|
+
expect(ENV['API_TOKEN']).to be nil
|
16
22
|
|
23
|
+
app.initialize!
|
17
24
|
expect(ENV['API_TOKEN']).to eq 'd33db55f'
|
18
25
|
end
|
19
26
|
end
|
27
|
+
|
28
|
+
it 'loads after the logger and before configuration' do
|
29
|
+
railtie_index = initializers.find_index(railtie_name)
|
30
|
+
logger_index = initializers.find_index(:initialize_logger)
|
31
|
+
config_index = initializers.find_index(:load_config_initializers)
|
32
|
+
|
33
|
+
expect(railtie_index).to be_between(logger_index, config_index)
|
34
|
+
end
|
20
35
|
end
|
21
36
|
end
|
22
37
|
end
|