configuration_service 1.1.4 → 2.0.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 +4 -4
- data/.gitignore +1 -0
- data/README.rdoc +4 -10
- data/lib/configuration_service/base.rb +4 -2
- data/lib/configuration_service/errors.rb +7 -0
- data/lib/configuration_service/factory/environment_context.rb +2 -5
- data/lib/configuration_service/test/orchestration_provider.rb +2 -0
- data/lib/configuration_service/version.rb +1 -1
- metadata +1 -2
- data/Gemfile.lock +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddbe076b82f49004024915c4940b8c4b659f987c
|
4
|
+
data.tar.gz: f6ef3e349a750383dc5c13239b0e1cbb3e9a7b2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83dcd2e4e86d9d330e052ea60a17ce04cba84fd571476b7ae41dd5e162e918875fc5941397bcabb311a40bccecffb0525d616a087e65f6b9c75f21f7b85eec80
|
7
|
+
data.tar.gz: 0588eeb4508c67bbee33604807a444bf3f832ee1d84f94f3ff9bd1f2126f4cd0217ac6af32bbbc61976f3923128097263ca32600e2713beb7322b0d0cc50849b
|
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
@@ -36,11 +36,8 @@ Our +main.rb+ (or +config.ru+ or whatever) is simple:
|
|
36
36
|
Bundler.require(:default)
|
37
37
|
|
38
38
|
service = ConfigurationService::Factory::EnvironmentContext.create
|
39
|
-
|
40
|
-
|
41
|
-
else
|
42
|
-
raise "configuration not found"
|
43
|
-
end
|
39
|
+
configuraton = service.request_configuration
|
40
|
+
AcmeApplication.new(configuration.data).run
|
44
41
|
|
45
42
|
This relies on a bundler Gemfile to load the gem that contains whatever
|
46
43
|
service provider we configure in the environment:
|
@@ -76,9 +73,6 @@ construct the service yourself:
|
|
76
73
|
address: "http://127.0.0.1:8200"
|
77
74
|
)
|
78
75
|
)
|
79
|
-
|
80
|
-
|
81
|
-
else
|
82
|
-
raise "configuration not found"
|
83
|
-
end
|
76
|
+
configuraton = service.request_configuration
|
77
|
+
AcmeApplication.new(configuration.data).run
|
84
78
|
|
@@ -42,10 +42,12 @@ module ConfigurationService
|
|
42
42
|
# Delegates the request to the provider.
|
43
43
|
#
|
44
44
|
# Returns a Configuration object or raises an Error on failure.
|
45
|
-
#
|
45
|
+
# Raises ConfigurationNotFoundError if no matching configuration
|
46
|
+
# was found.
|
46
47
|
#
|
47
48
|
def request_configuration
|
48
|
-
@provider.request_configuration(@identifier, @token)
|
49
|
+
@provider.request_configuration(@identifier, @token) or
|
50
|
+
raise ConfigurationNotFoundError, "configuration not found for identifier: #{@identifier}"
|
49
51
|
end
|
50
52
|
|
51
53
|
##
|
@@ -26,11 +26,8 @@ module ConfigurationService
|
|
26
26
|
# Bundler.require(:default) # Registers the vault provider
|
27
27
|
#
|
28
28
|
# service = ConfigurationService::Factory::EnvironmentContext.create
|
29
|
-
#
|
30
|
-
#
|
31
|
-
# else
|
32
|
-
# raise "configuration not found"
|
33
|
-
# end
|
29
|
+
# configuraton = service.request_configuration
|
30
|
+
# AcmeApplication.new(configuration.data).run
|
34
31
|
#
|
35
32
|
class EnvironmentContext
|
36
33
|
|
@@ -252,6 +252,8 @@ module ConfigurationService
|
|
252
252
|
def wrap_response # :nodoc:
|
253
253
|
begin
|
254
254
|
ConfigurationService::Test::Response::Success.new(yield)
|
255
|
+
rescue ConfigurationService::ConfigurationNotFoundError
|
256
|
+
ConfigurationService::Test::Response::Success.new(nil)
|
255
257
|
rescue ConfigurationService::Error => e
|
256
258
|
ConfigurationService::Test::Response::Failure.new(e)
|
257
259
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configuration_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sheldon Hearn
|
@@ -91,7 +91,6 @@ files:
|
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
93
|
- Gemfile
|
94
|
-
- Gemfile.lock
|
95
94
|
- README.md
|
96
95
|
- README.rdoc
|
97
96
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
configuration_service (1.1.3)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
builder (3.2.2)
|
10
|
-
cucumber (2.0.2)
|
11
|
-
builder (>= 2.1.2)
|
12
|
-
cucumber-core (~> 1.2.0)
|
13
|
-
diff-lcs (>= 1.1.3)
|
14
|
-
gherkin (~> 2.12)
|
15
|
-
multi_json (>= 1.7.5, < 2.0)
|
16
|
-
multi_test (>= 0.1.2)
|
17
|
-
cucumber-core (1.2.0)
|
18
|
-
gherkin (~> 2.12.0)
|
19
|
-
diff-lcs (1.2.5)
|
20
|
-
gherkin (2.12.2)
|
21
|
-
multi_json (~> 1.3)
|
22
|
-
multi_json (1.11.2)
|
23
|
-
multi_test (0.1.2)
|
24
|
-
rake (10.4.2)
|
25
|
-
rspec (3.3.0)
|
26
|
-
rspec-core (~> 3.3.0)
|
27
|
-
rspec-expectations (~> 3.3.0)
|
28
|
-
rspec-mocks (~> 3.3.0)
|
29
|
-
rspec-core (3.3.2)
|
30
|
-
rspec-support (~> 3.3.0)
|
31
|
-
rspec-expectations (3.3.1)
|
32
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.3.0)
|
34
|
-
rspec-mocks (3.3.2)
|
35
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.3.0)
|
37
|
-
rspec-support (3.3.0)
|
38
|
-
|
39
|
-
PLATFORMS
|
40
|
-
ruby
|
41
|
-
|
42
|
-
DEPENDENCIES
|
43
|
-
bundler (~> 1.10)
|
44
|
-
configuration_service!
|
45
|
-
cucumber (~> 2.0)
|
46
|
-
rake (~> 10.0)
|
47
|
-
rspec (~> 3.3)
|
48
|
-
rspec-expectations (~> 3.3)
|
49
|
-
|
50
|
-
BUNDLED WITH
|
51
|
-
1.10.3
|