berkeley_library-docker 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: d133859ef409d32d22e2b40723ca7fcfd34a551fb5176f7c3cc039cbe4f72037
4
- data.tar.gz: be63d139a376a470995b4bd60a6e9ebf4619d4f3f8be9317ae6541acad8e999c
3
+ metadata.gz: 75df4187f362680f782f8ce0e4d7a5aa438c4f86f44d1337c0495253e1b4733a
4
+ data.tar.gz: 51fdf2f4e9f29080bda4d7fe93096c0d314def1649f6a7da70290324ca7f642a
5
5
  SHA512:
6
- metadata.gz: 6a3d87d5d45aeed03e0a925151a747fd76fa5063f8f874536caec060668fe2707243148f31d51462a6afaa986732f8384b4b0c7f90cdd64a384f90098fb02d6f
7
- data.tar.gz: 14a858e4d44f9cf038664f950c4aa706fdb0e0645e5b48b49f858b378bcc6e54ee5a3f5e88e8f372598718023c94520175bac9815387d765a21f9d819675509c
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.0'.freeze
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
- config.before_configuration { Secret.load_secrets! }
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
- before do
9
- expect(ENV['API_TOKEN']).to be nil
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
- class TestApp < Rails::Application; end
15
- TestApp.create.initialize!
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkeley_library-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Schmidt