Class: Generamba::RambafileGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/generamba/code_generation/rambafile_generator.rb

Overview

Responsible for creating Generamba configs

Class Method Summary collapse

Class Method Details

.create_rambafile(properties) ⇒ Object

Creates a Rambafile using the provided properties hashmap

Parameters:

  • properties

    Rambafile properties

Returns:

  • void



12
13
14
15
16
17
18
19
20
21
# File 'lib/generamba/code_generation/rambafile_generator.rb', line 12

def self.create_rambafile(properties)
  file_source = IO.read(File.dirname(__FILE__) + '/Rambafile.liquid')

  template = Liquid::Template.parse(file_source)
  output = template.render(properties).gsub!(/[\n]{3,}/, "\n\n");

  File.open(RAMBAFILE_NAME, 'w+') {|f|
    f.write(output)
  }
end