Class: Dockerspec::Configuration
- Inherits:
-
Object
- Object
- Dockerspec::Configuration
- Defined in:
- lib/dockerspec/configuration.rb
Overview
Saves internal configuration for Dockerspec.
- The test engines to Run: Specinfra, ...
- The internal library used to run Docker.
Instance Attribute Summary collapse
-
#compose_runner ⇒ Class
The Runner::Compose class used to run Docker Compose.
-
#docker_runner ⇒ Class
The Runner class used to run Docker.
-
#engines ⇒ Array<Class>
readonly
A list of test engines used to run the tests.
Class Method Summary collapse
-
.add_engine(engine) ⇒ Object
Adds a class to use as engine to run the tests.
-
.compose_runner ⇒ Class
Gets the class used to start Docker Compose.
-
.compose_runner=(runner) ⇒ Object
Sets the class used to start Docker Compose.
-
.docker_runner ⇒ Class
Gets the class used to create and start Docker Containers.
-
.docker_runner=(runner) ⇒ Object
Sets the class used to create and start Docker Containers.
-
.engines ⇒ Array<Class>
Gets the engine classes used to run the tests.
-
.reset ⇒ Object
Resets the internal Configuration singleton object.
Instance Method Summary collapse
-
#add_engine(engine) ⇒ Object
private
Adds a class to use as engine to run the tests.
Instance Attribute Details
#compose_runner ⇒ Class
The Runner::Compose class used to run Docker Compose.
43 44 45 |
# File 'lib/dockerspec/configuration.rb', line 43 def compose_runner @compose_runner end |
#docker_runner ⇒ Class
The Runner class used to run Docker.
36 37 38 |
# File 'lib/dockerspec/configuration.rb', line 36 def docker_runner @docker_runner end |
#engines ⇒ Array<Class> (readonly)
A list of test engines used to run the tests.
50 51 52 |
# File 'lib/dockerspec/configuration.rb', line 50 def engines @engines end |
Class Method Details
.add_engine(engine) ⇒ Object
Adds a class to use as engine to run the tests.
65 66 67 |
# File 'lib/dockerspec/configuration.rb', line 65 def add_engine(engine) instance.add_engine(engine) end |
.compose_runner ⇒ Class
Gets the class used to start Docker Compose.
130 131 132 |
# File 'lib/dockerspec/configuration.rb', line 130 def compose_runner instance.compose_runner end |
.compose_runner=(runner) ⇒ Object
Sets the class used to start Docker Compose.
119 120 121 |
# File 'lib/dockerspec/configuration.rb', line 119 def compose_runner=(runner) instance.compose_runner = runner end |
.docker_runner ⇒ Class
Gets the class used to create and start Docker Containers.
103 104 105 |
# File 'lib/dockerspec/configuration.rb', line 103 def docker_runner instance.docker_runner end |
.docker_runner=(runner) ⇒ Object
Sets the class used to create and start Docker Containers.
92 93 94 |
# File 'lib/dockerspec/configuration.rb', line 92 def docker_runner=(runner) instance.docker_runner = runner end |
.engines ⇒ Array<Class>
Gets the engine classes used to run the tests.
76 77 78 |
# File 'lib/dockerspec/configuration.rb', line 76 def engines instance.engines end |
.reset ⇒ Object
Resets the internal Configuration singleton object.
141 142 143 |
# File 'lib/dockerspec/configuration.rb', line 141 def reset @instance = nil end |
Instance Method Details
#add_engine(engine) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds a class to use as engine to run the tests.
168 169 170 171 |
# File 'lib/dockerspec/configuration.rb', line 168 def add_engine(engine) @engines << engine @engines.uniq! end |