<commit_before>class Heap
  module ViewHelpers
    def heap_analytics
      javascript_tag :type => "text/javascript" do
        raw %Q{
          window.heap=window.heap||[],heap.load=function(t,e){window.heap.appid=t,window.heap.config=e;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"===document.location.protocol?"https:":"http:")+"//cdn.heapanalytics.com/js/heap.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(t){return function(){heap.push([t].concat(Array.prototype.slice.call(arguments,0)))}},p=["clearEventProperties","identify","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
          heap.load("#{Heap.app_id}");
          }.html_safe
      end
    end

    def heap_identify(email, properties=nil)
      body = properties.map {|k,v| ", #{k}: \"#{v}\""}.join if properties.is_a? Hash
      javascript_tag do
        raw %Q{heap.identify({email: "#{email}" #{body}}); }.html_safe
      end

    end
  end
end<commit_msg>updated JS snippet to version for Feb 26 2015<commit_after>class Heap
  module ViewHelpers
    def heap_analytics
      javascript_tag :type => "text/javascript" do
        raw %Q{
          window.heap=window.heap||[],heap.load=function(t,e){window.heap.appid=t,window.heap.config=e;var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=("https:"===document.location.protocol?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+t+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(t){return function(){heap.push([t].concat(Array.prototype.slice.call(arguments,0)))}},p=["clearEventProperties","identify","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
          heap.load("#{Heap.app_id}");
          }.html_safe
      end
    end

    def heap_identify(email, properties=nil)
      body = properties.map {|k,v| ", #{k}: \"#{v}\""}.join if properties.is_a? Hash
      javascript_tag do
        raw %Q{heap.identify({email: "#{email}" #{body}}); }.html_safe
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.20100732600732601, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 4.78042328042328, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, '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': '2725801', 'n_tokens_mistral': 766, 'n_tokens_neox': 750, 'n_words': 93}