Class: Giblish::Configurator

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/configurator.rb

Overview

AIDEV-NOTE: Assembles configuration from specialized builders following composition pattern

Direct Known Subclasses

GitRepoConfigurator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_opts) ⇒ Configurator

Creates configuration by assembling layout, DocId, and index configurations.

Parameters:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/giblish/configurator.rb', line 25

def initialize(config_opts)
  @config_opts = config_opts
  @resource_paths = ResourcePaths.new(config_opts)

  # Build layout configuration
  layout_config = build_layout_config(config_opts)

  # Initialize doc attribute builder
  @doc_attr = DocAttrBuilder.new(
    GiblishDefaultDocAttribs.new,
    *layout_config.docattr_providers,
    CmdLineDocAttribs.new(config_opts)
  )

  # Build feature configurations
  docid_config = DocIdConfigBuilder.build(config_opts)
  index_config = build_index_config(config_opts)

  # Assemble final build options
  @build_options = assemble_build_options(layout_config, docid_config, index_config, config_opts)
end

Instance Attribute Details

#build_optionsHash (readonly)

Returns Build options for TreeConverter.

Returns:

  • (Hash)

    Build options for TreeConverter



14
15
16
# File 'lib/giblish/configurator.rb', line 14

def build_options
  @build_options
end

#config_optsCmdLine::Options (readonly)

Returns User configuration options.

Returns:



20
21
22
# File 'lib/giblish/configurator.rb', line 20

def config_opts
  @config_opts
end

#doc_attrDocAttrBuilder (readonly)

Returns Document attribute builder.

Returns:



17
18
19
# File 'lib/giblish/configurator.rb', line 17

def doc_attr
  @doc_attr
end