Method: Cog::Config#prepare

Defined in:
lib/cog/config.rb

#prepare(opt = {}) ⇒ Object

Must be called once before using cog. In the context of a command-line invocation, this method will be called automatically. Outside of that context, for example in a unit test, it will have to be called manually.

Parameters:

  • opt (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opt):

  • :fullpaths (Boolean) — default: false

    when listing files, full paths should be shown

  • :minimal (Boolean) — default: false

    only load the built-in Cogfile

  • :project_cogfile_path (String) — default: nil

    explicitly specify the location of the project DSL::Cogfile. If not provided, it will be searched for. If none can be found, Cog::Config::ProjectConfig#project? will be false



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/cog/config.rb', line 61

def prepare(opt={})
  throw :ConfigInstanceAlreadyPrepared if @prepared && !opt[:force_reset]
  @prepared = true
  @fullpaths = opt[:fullpaths]
  @project_path = nil
  @project_generator_path = nil
  @project_plugin_path = nil
  @project_template_path = nil
  @generator_path = []
  @plugin_path = []
  @template_path = []
  @plugins = {}
  @target_language = Language.new
  @active_languages = [Language.new] # active language stack
  @language = {}
  @language_extension_map = {}
  
  process_cogfiles opt
  post_cogfile_processing
  build_language_extension_map
end