configuration_service 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,61 @@
1
+ require "configuration_service/provider/stub"
2
+ require "configuration_service/test"
3
+
4
+ module ConfigurationService
5
+
6
+ module Test
7
+
8
+ ##
9
+ # Test Orchestrator provider for testing the Stub service provider
10
+ #
11
+ # Registered to the OrchestrationProviderRegistry as +stub+.
12
+ #
13
+ class StubOrchestrationProvider < OrchestrationProvider
14
+
15
+ private
16
+
17
+ ##
18
+ # Returns a new Stub
19
+ #
20
+ # The object is initialized with the currently #authorize'd +token+
21
+ # and consistently used configuration +identifier+.
22
+ #
23
+ def service_provider # :doc:
24
+ ConfigurationService::Provider::Stub.new(@identifier, @token)
25
+ end
26
+
27
+ ##
28
+ # Returns a new Broken
29
+ #
30
+ def broken_service_provider # :doc:
31
+ ConfigurationService::Provider::Broken.new
32
+ end
33
+
34
+ ##
35
+ # Returns a token for +role+
36
+ #
37
+ # The token is taken from +BUILTIN_TOKENS+ in Stub
38
+ #
39
+ def token_for(role) # :doc:
40
+ ConfigurationService::Provider::Stub::BUILTIN_TOKENS[role]
41
+ end
42
+
43
+ ##
44
+ # Delete configuration from the StubStore
45
+ #
46
+ # The consistently used configuration +identifier+ is used to identify
47
+ # the configuration to be deleted.
48
+ #
49
+ # Deleting non-existent configuration is not an error.
50
+ #
51
+ def delete_configuration # :doc:
52
+ ConfigurationService::Provider::StubStore.instance.delete(@identifier)
53
+ end
54
+
55
+ end
56
+
57
+ OrchestrationProviderRegistry.instance.register("stub", StubOrchestrationProvider)
58
+
59
+ end
60
+
61
+ end
@@ -0,0 +1,25 @@
1
+ Dir.glob(File.expand_path("../test/**/*.rb", __FILE__), &method(:require))
2
+
3
+ module ConfigurationService
4
+
5
+ ##
6
+ # Support module for testing configuration service implementations
7
+ #
8
+ # The following are used directly by the cucumber test suite, and
9
+ # should not be of immediate interest to implementors:
10
+ #
11
+ # * Orchestrator
12
+ # * OrchestratorEnvironmentFactory
13
+ # * StubOrchestrationProvider
14
+ #
15
+ # The following are of interest to implementors:
16
+ #
17
+ # * OrchestrationProviderRegistry
18
+ # * Response
19
+ # * OrchestrationProvider
20
+ #
21
+ module Test
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1,17 @@
1
+ require "configuration_service/base"
2
+ require "configuration_service/configuration"
3
+ require "configuration_service/errors"
4
+
5
+ ##
6
+ # See ConfigurationService::Base.
7
+ #
8
+ module ConfigurationService
9
+
10
+ ##
11
+ # Creates a new ConfigurationService::Base for the +provider+
12
+ #
13
+ def self.new(provider)
14
+ ConfigurationService::Base.new(provider)
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,121 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: configuration_service
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sheldon Hearn
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: cucumber
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-expectations
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.3'
69
+ description: Configuration service
70
+ email:
71
+ - sheldonh@starjuice.net
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - Gemfile.lock
79
+ - README.md
80
+ - README.rdoc
81
+ - Rakefile
82
+ - configuration_service.gemspec
83
+ - lib/configuration_service.rb
84
+ - lib/configuration_service/base.rb
85
+ - lib/configuration_service/configuration.rb
86
+ - lib/configuration_service/errors.rb
87
+ - lib/configuration_service/provider.rb
88
+ - lib/configuration_service/provider/broken.rb
89
+ - lib/configuration_service/provider/stub.rb
90
+ - lib/configuration_service/provider/stub_store.rb
91
+ - lib/configuration_service/test.rb
92
+ - lib/configuration_service/test/orchestration_provider.rb
93
+ - lib/configuration_service/test/orchestration_provider_registry.rb
94
+ - lib/configuration_service/test/orchestrator.rb
95
+ - lib/configuration_service/test/orchestrator_environment_factory.rb
96
+ - lib/configuration_service/test/response.rb
97
+ - lib/configuration_service/test/stub_orchestration_provider.rb
98
+ homepage: https://github.com/hetznerZA/configuration_service
99
+ licenses: []
100
+ metadata: {}
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubyforge_project:
117
+ rubygems_version: 2.4.8
118
+ signing_key:
119
+ specification_version: 4
120
+ summary: Configuration service
121
+ test_files: []