<commit_before>module DeferredJsInclude
  def deferred_js(*sources)
    @deferred_javascripts ||= []
    @deferred_javascripts += sources
  end
  
  def include_deferred_js(*opts)
    js = @deferred_javascripts.collect {|x| x.to_s}
    js.uniq!
    
    # If they want caching, we'll do it for the entire set of files
    options = opts.extract_options!.stringify_keys
    cache = options.delete("cache")
    if cache
      # If they passed 'true' then we create the name, otherwise we pass along the string/symbol they passed
      options[:cache] = (cache == true) ? js.join("_") : cache
    end
    
    js << options
    javascript_include_tag(*js)
  end
end<commit_msg>Fixed a bug when there are no javascript files to load.<commit_after>module DeferredJsInclude
  def deferred_js(*sources)
    @deferred_javascripts ||= []
    @deferred_javascripts += sources
  end
  
  def include_deferred_js(*opts)
    return unless @deferred_javascripts && !@deferred_javascripts.empty?
    
    js = @deferred_javascripts.collect {|x| x.to_s}
    js.uniq!
    
    # If they want caching, we'll do it for the entire set of files
    options = opts.extract_options!.stringify_keys
    cache = options.delete("cache")
    if cache
      # If they passed 'true' then we create the name, otherwise we pass along the string/symbol they passed
      options[:cache] = (cache == true) ? js.join("_") : cache
    end
    
    js << options
    javascript_include_tag(*js)
  end
end
{'fraction_non_alphanumeric': 0.09536784741144415, 'fraction_numerical': 0.0, 'mean_word_length': 3.2579710144927536, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4481374', 'n_tokens_mistral': 462, 'n_tokens_neox': 447, 'n_words': 137}