Class: Gitploy::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/gitploy.rb

Constant Summary collapse

REQUIRED_OPTIONS =
[:path, :user, :host]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#local_branchObject

Returns the value of attribute local_branch.



8
9
10
# File 'lib/gitploy.rb', line 8

def local_branch
  @local_branch
end

#remote_branchObject

Returns the value of attribute remote_branch.



8
9
10
# File 'lib/gitploy.rb', line 8

def remote_branch
  @remote_branch
end

Instance Method Details

#check!Object



10
11
12
13
14
# File 'lib/gitploy.rb', line 10

def check!
  unless missing_options.empty?
    raise "The following configuration options are missing for the '#{Gitploy.current_stage}' stage: #{missing_options.join(', ')}"
  end
end

#missing_optionsObject



16
17
18
# File 'lib/gitploy.rb', line 16

def missing_options
  REQUIRED_OPTIONS.select {|m| send(m).nil? }
end