<commit_before><%
  def always_array(var)
    if var.is_a?(Array)
      return var
    elsif var.is_a?(Hash)
      return var.map{ |k,v| "#{k} #{v}" }
    elsif var.is_a?(String)
      return [var]
    else
      return []
    end
  end

  ## Sanitize variables
  proxiez_pass = always_array(proxypass)
  proxiez_reverse = always_array(proxypassreverse)

-%>
ProxyRequests Off

<Proxy <%= proxy_url %>>
  Order <%= allow_order %>
<% if allow_from != '' -%>
  Allow from <%= allow_from %>
<% end -%>
<% if deny_from != '' -%>
  Deny from <%= deny_from %>
<% end -%>
</Proxy>

<% proxiez_pass.each do |p| -%>
  ProxyPass <%= p %>
<% end -%>

<% proxiez_reverse.each do |p| -%>
  ProxyPassReverse  <%= p %>
<% end -%><commit_msg>Added custom content and puppet header to reverse proxy template<commit_after><%
  def always_array(var)
    if var.is_a?(Array)
      return var
    elsif var.is_a?(Hash)
      return var.map{ |k,v| "#{k} #{v}" }
    elsif var.is_a?(String)
      return [var]
    else
      return []
    end
  end

  ## Sanitize variables
  proxiez_pass = always_array(proxypass)
  proxiez_reverse = always_array(proxypassreverse)

-%>
### File managed with puppet ###
### Served by:        '<%= scope.lookupvar('::servername') %>'
### Module:           '<%= scope.to_hash['module_name'] %>'
### Template source:  '<%= template_source %>'

  ProxyRequests Off

  <Proxy <%= proxy_url %>>
    Order <%= allow_order %>
<% if allow_from != '' -%>
    Allow from <%= allow_from %>
<% end -%>
<% if deny_from != '' -%>
    Deny from <%= deny_from %>
<% end -%>
  </Proxy>

<% proxiez_pass.each do |p| -%>
  ProxyPass <%= p %>
<% end -%>

<% proxiez_reverse.each do |p| -%>
  ProxyPassReverse  <%= p %>
<% end -%>

<% if content != '' %>
  # Below you will find the extra content you have defined.
  # This is NOT part of the puppet template.
  <%= content %>
<% end -%>

{'fraction_non_alphanumeric': 0.1848694725625999, 'fraction_numerical': 0.0, 'mean_word_length': 2.970401691331924, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7134534', 'n_tokens_mistral': 763, 'n_tokens_neox': 702, 'n_words': 161}