Class: VagrantPlugins::DockerComposeProvisioner::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-docker-compose/config.rb

Constant Summary collapse

DEFAULT_COMMAND_OPTIONS =
{
  rm: "--force",
  up: "-d"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



16
17
18
19
20
21
22
# File 'lib/vagrant-docker-compose/config.rb', line 16

def initialize
  @executable = UNSET_VALUE
  @project_name = UNSET_VALUE
  @compose_version = UNSET_VALUE
  @options = UNSET_VALUE
  @command_options = UNSET_VALUE
end

Instance Attribute Details

#command_optionsObject

Returns the value of attribute command_options.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def command_options
  @command_options
end

#compose_versionObject

Returns the value of attribute compose_version.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def compose_version
  @compose_version
end

#executableObject

Returns the value of attribute executable.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def executable
  @executable
end

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def options
  @options
end

#project_nameObject

Returns the value of attribute project_name.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def project_name
  @project_name
end

#rebuildObject

Returns the value of attribute rebuild.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def rebuild
  @rebuild
end

#ymlObject

Returns the value of attribute yml.



9
10
11
# File 'lib/vagrant-docker-compose/config.rb', line 9

def yml
  @yml
end

Instance Method Details

#finalize!Object



24
25
26
27
28
29
30
31
# File 'lib/vagrant-docker-compose/config.rb', line 24

def finalize!
  @executable = "/usr/local/bin/docker-compose" if @executable == UNSET_VALUE
  @project_name = nil if @project_name == UNSET_VALUE
  @compose_version = "1.5.0" if @compose_version == UNSET_VALUE
  @options = nil if @options == UNSET_VALUE
  @command_options = {} if @command_options == UNSET_VALUE
  @command_options = DEFAULT_COMMAND_OPTIONS.merge(@command_options)
end