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.



16
17
18
19
20
21
# File 'lib/xanthus/configuration.rb', line 16

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

Instance Attribute Details

#affiliationObject

Returns the value of attribute affiliation.



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

def affiliation
  @affiliation
end

#authorsObject

Returns the value of attribute authors.



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

def authors
  @authors
end

#dataverse_confObject

Returns the value of attribute dataverse_conf.



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

def dataverse_conf
  @dataverse_conf
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#github_confObject

Returns the value of attribute github_conf.



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

def github_conf
  @github_conf
end

#jobsObject

Returns the value of attribute jobs.



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

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.



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

def params
  @params
end

#scriptsObject

Returns the value of attribute scripts.



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

def scripts
  @scripts
end

#seedObject

Returns the value of attribute seed.



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

def seed
  @seed
end

#vmsObject

Returns the value of attribute vms.



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

def vms
  @vms
end

Instance Method Details

#dataverse {|dataverse| ... } ⇒ Object

Yields:



47
48
49
50
51
# File 'lib/xanthus/configuration.rb', line 47

def dataverse
  dataverse = Dataverse.new
  yield(dataverse)
  @dataverse_conf = dataverse
end

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

Yields:



41
42
43
44
45
# File 'lib/xanthus/configuration.rb', line 41

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

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

Yields:

  • (v)


34
35
36
37
38
39
# File 'lib/xanthus/configuration.rb', line 34

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

#script(name) ⇒ Object



30
31
32
# File 'lib/xanthus/configuration.rb', line 30

def script name
  @scripts[name] = yield
end

#to_readme_mdObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/xanthus/configuration.rb', line 53

def to_readme_md
  %Q{
# #{@name}

authors: #{@authors}
affiliation: #{@affiliation}
email: #{@email}

seed: #{@seed}

## Description

#{@description}
  }
end

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

Yields:



23
24
25
26
27
28
# File 'lib/xanthus/configuration.rb', line 23

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