Class: VagrantPlugins::VagrantGit::Config

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

Constant Summary collapse

@@repo_configs =

Singleton for each VM

[]

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.repo_configsObject

Returns the value of attribute repo_configs.



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

def repo_configs
  @repo_configs
end

Instance Method Details

#add_repo {|rc| ... } ⇒ Object

Yields:

  • (rc)


14
15
16
17
18
19
# File 'lib/vagrant-git/config.rb', line 14

def add_repo
  # Yield a new repo config object to the config block
  rc = RepoConfig.new
  yield rc
  @@repo_configs.push rc
end

#finalize!Object



32
33
34
35
36
# File 'lib/vagrant-git/config.rb', line 32

def finalize!
  @@repo_configs.each do |config|
    config.finalize!
  end
end

#to_hashObject



10
11
12
# File 'lib/vagrant-git/config.rb', line 10

def to_hash
  { :repos => @@repo_configs }
end

#validate(machine) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/vagrant-git/config.rb', line 21

def validate(machine)
  errors = {}
  @@repo_configs.each_with_index do |rc, i|
    rc_errors = rc.validate
    if rc_errors.length > 0
      errors[i] = rc_errors
    end
  end
  errors
end