Class: Vagabond::CheffileLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/vagabond/helpers/cheffile_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ CheffileLoader

Returns a new instance of CheffileLoader.



6
7
8
9
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 6

def initialize(path=nil)
  @cookbooks = []
  load(path) if path
end

Instance Attribute Details

#cookbooksObject (readonly)

Returns the value of attribute cookbooks.



4
5
6
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 4

def cookbooks
  @cookbooks
end

Instance Method Details

#cookbook(name, *args) ⇒ Object



11
12
13
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 11

def cookbook(name, *args)
  cookbooks[name] = args
end

#load(path) ⇒ Object



15
16
17
# File 'lib/vagabond/helpers/cheffile_loader.rb', line 15

def load(path)
  instance_eval(File.read(path))
end