Class: Xanthus::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
# File 'lib/xanthus/configuration.rb', line 13

def initialize
  @params = Hash.new
  @vms = Hash.new
  @scripts = Hash.new
  @jobs = Hash.new
end

Instance Attribute Details

#authorsObject

Returns the value of attribute authors.



4
5
6
# File 'lib/xanthus/configuration.rb', line 4

def authors
  @authors
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/xanthus/configuration.rb', line 5

def description
  @description
end

#github_confObject

Returns the value of attribute github_conf.



11
12
13
# File 'lib/xanthus/configuration.rb', line 11

def github_conf
  @github_conf
end

#jobsObject

Returns the value of attribute jobs.



10
11
12
# File 'lib/xanthus/configuration.rb', line 10

def jobs
  @jobs
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/xanthus/configuration.rb', line 3

def name
  @name
end

#paramsObject

Returns the value of attribute params.



7
8
9
# File 'lib/xanthus/configuration.rb', line 7

def params
  @params
end

#scriptsObject

Returns the value of attribute scripts.



9
10
11
# File 'lib/xanthus/configuration.rb', line 9

def scripts
  @scripts
end

#seedObject

Returns the value of attribute seed.



6
7
8
# File 'lib/xanthus/configuration.rb', line 6

def seed
  @seed
end

#vmsObject

Returns the value of attribute vms.



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

def vms
  @vms
end

Instance Method Details

#github {|github| ... } ⇒ Object

Yields:



38
39
40
41
42
# File 'lib/xanthus/configuration.rb', line 38

def github
  github = GitHub.new
  yield(github)
  @github_conf = github
end

#job(name) {|v| ... } ⇒ Object

Yields:

  • (v)


31
32
33
34
35
36
# File 'lib/xanthus/configuration.rb', line 31

def job name
  v = Job.new
  yield(v)
  v.name = name
  @jobs[name] = v
end

#script(name) ⇒ Object



27
28
29
# File 'lib/xanthus/configuration.rb', line 27

def script name
  @scripts[name] = yield
end

#to_readme_mdObject



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/xanthus/configuration.rb', line 44

def to_readme_md
  %Q{
# #{@name}

Authors: #{@authors}

Seed: #{@seed}

## Description

#{@description}
  }
end

#vm(name) {|vm| ... } ⇒ Object

Yields:



20
21
22
23
24
25
# File 'lib/xanthus/configuration.rb', line 20

def vm name
  vm = VirtualMachine.new
  yield(vm)
  vm.name = name
  @vms[name] = vm
end