Class: VagrantPlugins::DockerComposeProvisioner::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::DockerComposeProvisioner::Config
- Defined in:
- lib/vagrant-docker-compose/config.rb
Constant Summary collapse
- DEFAULT_COMMAND_OPTIONS =
{ rm: "--force", up: "-d" }
Instance Attribute Summary collapse
-
#command_options ⇒ Object
Returns the value of attribute command_options.
-
#compose_version ⇒ Object
Returns the value of attribute compose_version.
-
#env ⇒ Object
Returns the value of attribute env.
-
#executable_install_path ⇒ Object
Returns the value of attribute executable_install_path.
-
#executable_symlink_path ⇒ Object
Returns the value of attribute executable_symlink_path.
-
#options ⇒ Object
Returns the value of attribute options.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#rebuild ⇒ Object
Returns the value of attribute rebuild.
-
#yml ⇒ Object
Returns the value of attribute yml.
Instance Method Summary collapse
- #env_s ⇒ Object
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
19 20 21 22 23 24 25 26 27 |
# File 'lib/vagrant-docker-compose/config.rb', line 19 def initialize @project_name = UNSET_VALUE @compose_version = UNSET_VALUE @env = UNSET_VALUE @executable_symlink_path = UNSET_VALUE @executable_install_path = UNSET_VALUE @options = UNSET_VALUE @command_options = UNSET_VALUE end |
Instance Attribute Details
#command_options ⇒ Object
Returns the value of attribute command_options.
9 10 11 |
# File 'lib/vagrant-docker-compose/config.rb', line 9 def @command_options end |
#compose_version ⇒ Object
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 |
#env ⇒ Object
Returns the value of attribute env.
9 10 11 |
# File 'lib/vagrant-docker-compose/config.rb', line 9 def env @env end |
#executable_install_path ⇒ Object
Returns the value of attribute executable_install_path.
9 10 11 |
# File 'lib/vagrant-docker-compose/config.rb', line 9 def executable_install_path @executable_install_path end |
#executable_symlink_path ⇒ Object
Returns the value of attribute executable_symlink_path.
9 10 11 |
# File 'lib/vagrant-docker-compose/config.rb', line 9 def executable_symlink_path @executable_symlink_path end |
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/vagrant-docker-compose/config.rb', line 9 def @options end |
#project_name ⇒ Object
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 |
#rebuild ⇒ Object
Returns the value of attribute rebuild.
9 10 11 |
# File 'lib/vagrant-docker-compose/config.rb', line 9 def rebuild @rebuild end |
#yml ⇒ Object
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
#env_s ⇒ Object
40 41 42 |
# File 'lib/vagrant-docker-compose/config.rb', line 40 def env_s @env.map { |k, v| "#{k}=#{Shellwords.escape(v)}" }.join(" ") end |
#finalize! ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/vagrant-docker-compose/config.rb', line 29 def finalize! @project_name = nil if @project_name == UNSET_VALUE @compose_version = "1.24.1" if @compose_version == UNSET_VALUE @env = {} if @env == UNSET_VALUE @executable_symlink_path = "/usr/local/bin/docker-compose" if @executable_symlink_path == UNSET_VALUE @executable_install_path = "#{@executable_symlink_path}-#{@compose_version}" if @executable_install_path == UNSET_VALUE @options = nil if @options == UNSET_VALUE @command_options = {} if @command_options == UNSET_VALUE @command_options = DEFAULT_COMMAND_OPTIONS.merge(@command_options) end |