Class: VagrantPlugins::CapistranoPush::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-capistrano-push/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



9
10
11
# File 'lib/vagrant-capistrano-push/config.rb', line 9

def initialize
  @stage = UNSET_VALUE
end

Instance Attribute Details

#inlineObject

Returns the value of attribute inline.



7
8
9
# File 'lib/vagrant-capistrano-push/config.rb', line 7

def inline
  @inline
end

#stageString

The capistrano command (as a string) to execute.

Returns:

  • (String)


6
7
8
# File 'lib/vagrant-capistrano-push/config.rb', line 6

def stage
  @stage
end

Instance Method Details

#finalize!Object



13
14
15
16
# File 'lib/vagrant-capistrano-push/config.rb', line 13

def finalize!
  @stage = nil if @stage == UNSET_VALUE
  @inline = "bundle exec cap #{@stage} deploy"
end

#validate(machine) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vagrant-capistrano-push/config.rb', line 18

def validate(machine)
  errors = _detected_errors

  if missing?(@stage)
    errors << I18n.t("capistrano_push.errors.missing_attribute",
      attribute: "stage",
    )
  end

  { "Capistrano push" => errors }
end