Class: FryCook::Server

Inherits:
ChefZero::Server
  • Object
show all
Defined in:
lib/fry_cook/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(chef_options, fry_options) ⇒ Server

Returns a new instance of Server.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fry_cook/server.rb', line 6

def initialize(chef_options, fry_options)
  @work_tree = WorkTree.new(fry_options)
  @work_tree.build

  Chef::Config.node_path = @work_tree.node_path
  Chef::Config.cookbook_path = @work_tree.cookbook_path
  Chef::Config.role_path = @work_tree.role_path
  Chef::Config.data_bag_path = @work_tree.data_bag_path
  Chef::Config.environment_path = @work_tree.environment_path

  data_store = Chef::ChefFS::ChefFSDataStore.new(
    Chef::ChefFS::Config.new(Chef::Config).local_fs
  )
  chef_options[:data_store] = data_store

  super(chef_options)
end