Class: Dapp::Builder::Chef::Berksfile

Inherits:
Object
  • Object
show all
Defined in:
lib/dapp/builder/chef/berksfile.rb

Overview

Berksfile

Defined Under Namespace

Classes: Parser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(home_path, path) ⇒ Berksfile

Returns a new instance of Berksfile.



32
33
34
35
36
37
# File 'lib/dapp/builder/chef/berksfile.rb', line 32

def initialize(home_path, path)
  @home_path = home_path
  @path = path
  @local_cookbooks = {}
  @parser = Parser.new(self)
end

Instance Attribute Details

#local_cookbooks ⇒ Object (readonly)

Returns the value of attribute local_cookbooks.



30
31
32
# File 'lib/dapp/builder/chef/berksfile.rb', line 30

def local_cookbooks
  @local_cookbooks
end

#path ⇒ Object (readonly)

Parser



29
30
31
# File 'lib/dapp/builder/chef/berksfile.rb', line 29

def path
  @path
end

Instance Method Details

#add_local_cookbook_path(name, path) ⇒ Object



39
40
41
42
43
44
# File 'lib/dapp/builder/chef/berksfile.rb', line 39

def add_local_cookbook_path(name, path)
  @local_cookbooks[name] = {
    name: name,
    path: @home_path.join(path)
  }
end

#local_cookbook(name) ⇒ Object



50
51
52
# File 'lib/dapp/builder/chef/berksfile.rb', line 50

def local_cookbook(name)
  local_cookbooks[name]
end

#local_cookbook?(name) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/dapp/builder/chef/berksfile.rb', line 46

def local_cookbook?(name)
  local_cookbooks.key? name
end