Class: DockerCompose::Client
- Inherits:
-
Object
- Object
- DockerCompose::Client
- Defined in:
- lib/docker_compose/client.rb
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(opts = {}) ⇒ Client
Returns a new instance of Client.
4 5 6 7 |
# File 'lib/docker_compose/client.rb', line 4 def initialize(opts={}) @container_name = opts[:container_name] @cmd = opts[:cmd] end |
Instance Method Details
#exec ⇒ Object
9 10 11 |
# File 'lib/docker_compose/client.rb', line 9 def exec `docker exec $(docker ps -q --filter 'name=#{@container_name}') #{@cmd}` end |