Class: Blufin::YmlConfigurationWriter

Inherits:
YmlWriterBase show all
Defined in:
lib/core/yml_writers/yml_configuration_writer.rb

Constant Summary collapse

PLACEHOLDER_SERVICE =
'{{--PLACEHOLDER-SERVICE--}}'
PLACEHOLDER_PORT =
'{{--PLACEHOLDER-PORT--}}'

Constants inherited from YmlWriterBase

Blufin::YmlWriterBase::AUTO_TYPES, Blufin::YmlWriterBase::PLACEHOLDER_CLASS, Blufin::YmlWriterBase::PLACEHOLDER_IMPORT, Blufin::YmlWriterBase::PLACEHOLDER_PACKAGE, Blufin::YmlWriterBase::PLACEHOLDER_SCHEMA

Instance Method Summary collapse

Methods inherited from YmlWriterBase

#get_base_path, #get_java_path, #get_package, #get_package_from_file, #write_file_java

Constructor Details

#initialize(site) ⇒ Object

Initialize the class.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/core/yml_writers/yml_configuration_writer.rb', line 10

def initialize(site)

    @site          = Blufin::SiteResolver::validate_site(site)
    @site_name     = Blufin::SiteResolver::get_site_name(@site)
    @site_ports    = Blufin::SiteResolver::get_site_ports(@site)
    @site_domain   = Blufin::SiteResolver::get_site_domain(@site)
    @site_location = "#{Blufin::SiteResolver::get_site_location(@site)}/"

    @template_nginx = <<TEMPLATE
TEMPLATE

end

Instance Method Details

#writeObject

Write the file(s).

Returns:

  • void



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/core/yml_writers/yml_configuration_writer.rb', line 25

def write

    # TODO - Finish this. Needs to write YML configuration (passed to java) from DB values.
    file = nil

    contents = @template_nginx
    # contents = contents.gsub(PLACEHOLDER_SERVICE, service)
    # contents = contents.gsub(PLACEHOLDER_PORT, port.to_s)
    Blufin::Files.write_file(file, Blufin::YmlCommon::convert_string_to_line_array(contents))


end