def run(source, data)
      result = StringIO.new
      source = StringIO.new(source)

      begin
        generator = ErbGenerator.new(Data.new([HashWithIndifferentAccess.new(data)]))
        generator.compile(source, result)
      rescue RuntimeError => e
        Filegen::Ui.error e.message
      rescue Exceptions::ErbTemplateHasSyntaxErrors => e
        Filegen::Ui.error "Syntax error in ERB-Template: \n" + e.message
      end

      result.string
    end
def run(source, data)
      result = StringIO.new
      source = StringIO.new(source)

      begin
        generator = ErbGenerator.new(Data.new([HashWithIndifferentAccess.new(data)]))
        generator.compile(source, result)
      rescue RuntimeError => e
        Filegen::Ui.error e.message
      rescue Exceptions::ErbTemplateHasSyntaxErrors => e
        Filegen::Ui.error "Syntax error in ERB-Template: \n" + e.message
      end

      result.string
    end
Generate text

 @param [String] source
   The template used
 @param [Hash] data
   The data used within template evaluation
 @return [String]
   The evaluated template