Method: Chef2Wiki#initialize

Defined in:
lib/chef2wiki/base.rb

#initialize(options = {}) ⇒ Chef2Wiki

Returns a new instance of Chef2Wiki.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/chef2wiki/base.rb', line 10

def initialize(options = {})
  options[:config] ||= DEFAULT_CONFIG_PATH
  options[:templates] ||= DEFAULT_TEMPLATES_PATH
  options[:wiki] ||= :mediawiki

  @options = options
  @config = read_config(File.expand_path(options[:config]))
  @templates = register_templates(File.expand_path(options[:templates]))
  @wiki = case options[:wiki]
  when :mediawiki
    setup_media_wiki
  end

  Chef::Config.from_file(File.expand_path(config["chef"]["config"]))
end