<commit_before>```bash
  <%-
    data = {}
    path = path.gsub(/{([^}]*)}/) {|match| '$' + match.gsub(/[{}]/, '').upcase}
    get_params = []

    if link.has_key?('schema')
      payload = schema.schema_example(link['schema'])
      if payload.is_a?(Array)
        data = payload
      else
        data.merge!(payload)
      end

      if link['method'].upcase == 'GET' && !data.empty?
        get_params << Prmd::UrlGenerator.new({schema: schema, link: link, options: options}).url_params
      end
    end
    if link['method'].upcase != 'GET'
      options = options.dup
      options[:http_header] = { 'Content-Type' => options[:content_type] }.merge(options[:http_header])
    end
  %>
$ curl -n -X <%= link['method'] %> <%= schema.href %><%= path -%><%- unless options[:http_header].empty? %> \<%- end %>
  <%- options[:http_header].each do |key, value| %>
  -H "<%= key %>: <%= value %>" \
  <%- end %>
<%- if !data.empty? && link['method'].upcase != 'GET' %> \
  -d '<%= JSON.pretty_generate(data) %>'
<%- elsif !get_params.empty? && link['method'].upcase == 'GET' %> -G \
  -d <%= get_params.join(" \\\n  -d ") %>
<%- end %>

```<commit_msg>simplify hash/array logic in link_curl_example<commit_after>```bash
  <%-
    data = nil
    path = path.gsub(/{([^}]*)}/) {|match| '$' + match.gsub(/[{}]/, '').upcase}
    get_params = []

    if link.has_key?('schema')
      data = schema.schema_example(link['schema'])

      if link['method'].upcase == 'GET' && !data.nil?
        get_params << Prmd::UrlGenerator.new({schema: schema, link: link, options: options}).url_params
      end
    end
    if link['method'].upcase != 'GET'
      options = options.dup
      options[:http_header] = { 'Content-Type' => options[:content_type] }.merge(options[:http_header])
    end
  %>
$ curl -n -X <%= link['method'] %> <%= schema.href %><%= path -%><%- unless options[:http_header].empty? %> \<%- end %>
  <%- options[:http_header].each do |key, value| %>
  -H "<%= key %>: <%= value %>" \
  <%- end %>
<%- if !data.nil? && link['method'].upcase != 'GET' %> \
  -d '<%= JSON.pretty_generate(data) %>'
<%- elsif !get_params.empty? && link['method'].upcase == 'GET' %> -G \
  -d <%= get_params.join(" \\\n  -d ") %>
<%- end %>

```
{'fraction_non_alphanumeric': 0.24932735426008967, 'fraction_numerical': 0.0, 'mean_word_length': 2.9982078853046596, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 35, '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': '7315664', 'n_tokens_mistral': 858, 'n_tokens_neox': 784, 'n_words': 148}