<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,17 +1,17 @@
 module Component::Analytics
   class Block &lt; ActiveRecord::Base
     set_table_name &quot;analytics_blocks&quot;
-  
+
     belongs_to :component, :class_name =&gt; &quot;Component::Analytics::Configuration&quot;
-  
+
     before_save :compile!
-  
+
     include BreezeHq::Mixins::Options
     option :tracking_id
-  
+
     def self.template; &quot;&quot;; end
     def self.secure_template; &quot;&quot;; end
-  
+
     def regexp
       if self[:regexp].blank?
         nil
@@ -19,12 +19,12 @@ module Component::Analytics
         @_regexp ||= Regexp.new(self.class.normalize_regexp(self[:regexp]), Regexp::IGNORECASE)
       end
     end
-  
+
     def =~(path)
       enabled? &amp;&amp; (regexp.blank? || (!!(path =~ regexp) ^ exclude?))
     end
     alias_method :match, :=~
-  
+
     def apply(rendered_page, secure = false)
       if tracking_id.to_s.strip.blank?
         rendered_page
@@ -32,28 +32,28 @@ module Component::Analytics
         rendered_page.sub('&lt;/body&gt;') { (secure ? secure_code : code) + $&amp; }
       end
     end
-  
+
     def code
       compile! if self[:code].blank?
       super
     end
-  
+
     def secure_code
       compile! if self[:secure_code].blank?
       super
     end
-  
+
   protected
     def compile!
       self.code = self.class.compile(self.class.template, self)
       self.secure_code = self.class.compile(self.class.secure_template, self)
     end
-  
+
     def self.compile(template_to_compile, object)
       # TODO: is there a built-in way to do this?
       template_to_compile.gsub(/\#\{([^\}]+)\}/) { object.send $1.to_sym }
     end
-  
+
     def self.normalize_regexp(regexp)
       regexp.to_s.sub /\A(\^|\\A|\/)*/, '\A/'
     end</diff>
      <filename>app/models/component/analytics/block.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,11 @@
 module Component::Analytics
   class Configuration &lt; Component::Base
     has_many :blocks, :class_name =&gt; &quot;Component::Analytics::Block&quot;, :foreign_key =&gt; &quot;component_id&quot;
-    
+
     def after_render(rendered_content, page, controller)
       apply(controller.request.request_uri, rendered_content, controller.request.ssl?)
     end
-    
+
     def apply(path, rendered_page, secure = false)
       blocks.inject(rendered_page) do |memo, block|
         (block =~ path) ? block.apply(memo, secure) : memo</diff>
      <filename>app/models/component/analytics/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,14 +7,14 @@ module Component::Analytics
   document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
   &lt;/script&gt;
   &lt;script type=&quot;text/javascript&quot;&gt;
-  try{ 
+  try{
   var pageTracker = _gat._getTracker(&quot;#{tracking_id}&quot;);
   pageTracker._trackPageview();
-  } catch(err) {} 
+  } catch(err) {}
   &lt;/script&gt;
       CODE
     end
-  
+
     def apply_with_uniqueness_requirement(rendered_page, secure = false)
       if rendered_page.include?(&quot;google-analytics.com/ga.js&quot;)
         rendered_page
@@ -23,7 +23,7 @@ module Component::Analytics
       end
     end
     alias_method_chain :apply, :uniqueness_requirement
-  
+
     def self.secure_template
       template
     end</diff>
      <filename>app/models/component/analytics/google.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Component::Analytics
   class Quantcast &lt; Block
     option :tracking_id
-  
+
     def self.template
       &lt;&lt;-'CODE'
   &lt;!-- Start Quantcast tag --&gt;
@@ -33,7 +33,7 @@ module Component::Analytics
   &lt;!-- End Quantcast tag --&gt;
       CODE
     end
-  
+
     def apply_with_uniqueness_requirement(rendered_page, secure = false)
       if rendered_page.include?(&quot;quantserve.com/quant.js&quot;)
         rendered_page</diff>
      <filename>app/models/component/analytics/quantcast.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,55 +6,55 @@ describe Component::Analytics do
     @analytics = @site.components[Component::Analytics]
     @analytics.save
   end
-  
+
   describe &quot;block&quot; do
     before :each do
       @block = Component::Analytics::Block.new
     end
-    
+
     it &quot;should match all pages by default&quot; do
       @block.should match(&quot;/foo/bar&quot;)
     end
-    
+
     it &quot;should match the root page by default&quot; do
       @block.should match(&quot;/&quot;)
     end
-    
+
     it &quot;should not match if disabled&quot; do
       @block.enabled = false
       @block.should_not match(&quot;/foo&quot;)
     end
-    
+
     describe &quot;with an inclusive regexp&quot; do
       before :each do
         @block.regexp = &quot;^/foo.*&quot;
       end
-      
+
       it &quot;should match if the regexp matches&quot; do
         @block.should match(&quot;/foo/bar&quot;)
       end
-      
+
       it &quot;should not match if the regexp doesn't match&quot; do
         @block.should_not match(&quot;/boo&quot;)
       end
     end
-    
+
     describe &quot;with an exclusive regexp&quot; do
       before :each do
         @block.regexp = &quot;^/foo.*&quot;
         @block.exclude = true
       end
-      
+
       it &quot;should not match if the regexp matches&quot; do
         @block.should_not match(&quot;/foo/bar&quot;)
       end
-      
+
       it &quot;should match if the regexp doesn't match&quot; do
         @block.should match(&quot;/boo&quot;)
       end
     end
   end
-  
+
   describe &quot;on a page&quot; do
     before :each do
       @html = &lt;&lt;-HTML
@@ -79,27 +79,27 @@ describe Component::Analytics do
         @code = @analytics.apply &quot;/&quot;, @html
         @code.should match(/_getTracker\(&quot;UA-123456-x&quot;\);/)
       end
-      
+
       it &quot;should not include the code if the tracking id is blank&quot; do
         @google.update_attributes :tracking_id =&gt; &quot;&quot;
         @analytics.blocks(:reload)
         @code = @analytics.apply &quot;/&quot;, @html
         @code.should_not match(/_getTracker/)
       end
-      
+
       it &quot;should not include the code if it is disabled&quot; do
         @google.update_attributes :enabled =&gt; false
         @analytics.blocks(:reload)
         @code = @analytics.apply &quot;/&quot;, @html
         @code.should_not match(/_getTracker/)
       end
-      
+
       describe &quot;included multiple times&quot; do
         before :each do
           @google2 = Component::Analytics::Google.create :component =&gt; @analytics, :tracking_id =&gt; &quot;UA-123456-x&quot;
           @analytics.blocks(:reload).size.should == 2
         end
-        
+
         it &quot;should only include the code once&quot; do
           @code = @analytics.apply &quot;/&quot;, @html
           @code.scan('_getTracker(&quot;UA-123456-x&quot;);').size.should == 1
@@ -117,38 +117,38 @@ describe Component::Analytics do
         @code = @analytics.apply &quot;/&quot;, @html
         @code.should match(%r{http://pixel.quantserve.com/pixel/p-c3dkwYEDZXhiY.gif})
       end
-      
+
       it &quot;should apply the secure code on a secure page&quot; do
         @code = @analytics.apply &quot;/&quot;, @html, true
         @code.should match(%r{//secure.quantserve.com/pixel/p-c3dkwYEDZXhiY.gif})
       end
-      
+
       describe &quot;included multiple times&quot; do
         before :each do
           @qc2 = Component::Analytics::Quantcast.create :component =&gt; @analytics, :tracking_id =&gt; &quot;p-c3dkwYEDZXhiY&quot;
           @analytics.blocks(:reload).size.should == 2
         end
-        
+
         it &quot;should only include the code once&quot; do
           @code = @analytics.apply &quot;/&quot;, @html
           @code.scan('http://pixel.quantserve.com/pixel/p-c3dkwYEDZXhiY.gif').size.should == 1
         end
       end
     end
-    
+
     describe &quot;with both Google and Quantcast analytics&quot; do
       before :each do
         @google = Component::Analytics::Google.create :component =&gt; @analytics, :tracking_id =&gt; &quot;UA-123456-x&quot;
         @qc = Component::Analytics::Quantcast.create :component =&gt; @analytics, :tracking_id =&gt; &quot;p-c3dkwYEDZXhiY&quot;
         @analytics.blocks(:reload).size.should == 2
       end
-      
+
       it &quot;should insert the correct code on a page&quot; do
         @code = @analytics.apply &quot;/&quot;, @html
         @code.should match(/_getTracker\(&quot;UA-123456-x&quot;\);/)
         @code.should match(%r{http://pixel.quantserve.com/pixel/p-c3dkwYEDZXhiY.gif})
       end
-      
+
       it &quot;should apply the secure code on a secure page&quot; do
         @code = @analytics.apply &quot;/&quot;, @html, true
         @code.should match(/_getTracker\(&quot;UA-123456-x&quot;\);/)</diff>
      <filename>spec/models/component/analytics_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>24e836043f78b3f8b867f0ce22d979eda7fec522</id>
    </parent>
  </parents>
  <author>
    <name>Matt Powell</name>
    <email>fauxparse@gmail.com</email>
  </author>
  <url>http://github.com/leftclick/bhq-analytics/commit/af0d86a55a4b9a3277949d5b22a21f82e6217929</url>
  <id>af0d86a55a4b9a3277949d5b22a21f82e6217929</id>
  <committed-date>2009-11-05T16:09:06-08:00</committed-date>
  <authored-date>2009-11-05T16:09:06-08:00</authored-date>
  <message>hardcore whitespace stripping</message>
  <tree>f260887ff551901690714dd1649471fe5c968f67</tree>
  <committer>
    <name>Matt Powell</name>
    <email>fauxparse@gmail.com</email>
  </committer>
</commit>
