Class: R10K::Librarian

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

Defined Under Namespace

Classes: DSL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(puppetfile) ⇒ Librarian

Returns a new instance of Librarian.



8
9
10
11
12
# File 'lib/r10k/librarian.rb', line 8

def initialize(puppetfile)
  @puppetfile = puppetfile
  @modules    = []
  @forge      = 'forge.puppetlabs.com'
end

Instance Attribute Details

#forgeObject (readonly)

Returns the value of attribute forge.



6
7
8
# File 'lib/r10k/librarian.rb', line 6

def forge
  @forge
end

Instance Method Details

#add_module(name, args) ⇒ Object



26
27
28
# File 'lib/r10k/librarian.rb', line 26

def add_module(name, args)
  @modules << [name, args]
end

#loadObject



14
15
16
17
18
19
# File 'lib/r10k/librarian.rb', line 14

def load
  dsl = R10K::Librarian::DSL.new(self)
  dsl.instance_eval(File.read(@puppetfile), @puppetfile)

  @modules
end

#set_forge(forge) ⇒ Object

This method only exists because people tried being excessively clever.



22
23
24
# File 'lib/r10k/librarian.rb', line 22

def set_forge(forge)
  @forge = forge
end