<commit_before>module Rivet
  class Bootstrap
    attr_reader :config

    def initialize(config)
      @config = config.bootstrap
    end

    def user_data
      @user_data ||= generate_user_data
    end

    protected

    def generate_user_data
      template = ERB.new(File.read(config.template))
      template.result(config.instance_eval { binding })
    end
  end
end<commit_msg>Returns an empty string for userdata if no template is provided.<commit_after>module Rivet
  class Bootstrap
    attr_reader :config

    def initialize(config)
      @config = config.bootstrap
    end

    def user_data
      @user_data ||= generate_user_data
    end

    protected

    def generate_user_data
      if config.respond_to?(:template)
        template = ERB.new(File.read(config.template))
        template.result(config.instance_eval { binding })
      else
        ""
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06888888888888889, 'fraction_numerical': 0.0, 'mean_word_length': 2.6330645161290325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6474281', 'n_tokens_mistral': 269, 'n_tokens_neox': 256, 'n_words': 65}