<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -64,6 +64,8 @@ def run_reek(file, configuration)
     (0..2).to_a.each do |index|
       notifier_class.new(&quot;REEK WARNING&quot;, &quot;#{analyzer.code_smells[index]}&quot;, REEK_ICON).notify
     end
+    analyzer.to_html
+    Utils.run_command(&quot;firefox #{Utils::WORK_DIR}/reek.html&quot;)
   end
 end
 </diff>
      <filename>lib/continuous4r.watchr.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'utils.rb'
+require 'reek_builder.rb'
 # Analyseur de qualite de code Ruby
 # Author:: Vincent Dubois
 # Date : 05 octobre 2009 - version 0.0.5
@@ -18,15 +19,30 @@ class ReekAnalyzer
     reek_extracted_lines.each do |line|
       extract_content(line) unless line.strip.empty?
     end
-    File.delete(&quot;reek.log&quot;)
+    #File.delete(&quot;reek.log&quot;)
+  end
+
+  # extracting HTML for reek
+  def to_html
+    File.open(&quot;#{Utils::WORK_DIR}/reek.html&quot;, &quot;wb&quot;) do |file|
+      file.write(&quot;&lt;div id='bodyColumn'&gt;&lt;div class='contentBox'&gt;&quot;)
+      file.write(&quot;&lt;div class='section'&gt;&lt;a name='reek'&gt;&lt;/a&gt;&lt;h2&gt;Reek Results for #{@file}&lt;/h2&gt;&quot;)
+      file.write(&quot;&lt;p&gt;&lt;a href='http://reek.rubyforge.org/' target='_blank'&gt;Reek&lt;/a&gt; detects common code smells in ruby code.&lt;/p&gt;&quot;)
+      #file.write(Utils.heading_for_builder(&quot;Common code smells freeness : #{&quot;%0.2f&quot; % ReekBuilder.percent}%&quot;, ReekBuilder.percent) %&gt;
+      file.write(&quot;&lt;table class='bodyTable'&gt;&lt;tr&gt;&lt;th&gt;Code Smell&lt;/th&gt;&lt;/tr&gt;&quot;)
+      @code_smells.each_with_index do |code_smell, index|
+        file.write(&quot;&lt;tr class='#{index % 2 == 0 ? 'a' : 'b'}'&gt;&lt;td&gt;#{code_smell}&lt;/td&gt;&lt;/tr&gt;&quot;)
+      end
+      file.write(&quot;&lt;/table&gt;&lt;p&gt;Generated on #{Time.now.localtime}&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&quot;)
+    end
   end
 
   private
 
   # extracting content logic from flog log file
   def extract_content(str)
-    str_splitted = str.split(/  /)
-    @code_smells &lt;&lt; str_splitted[0]
+    @code_smells &lt;&lt; str.strip if str.match(/^ /)
   end
+
 end
 </diff>
      <filename>lib/reek_analyzer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,19 +6,23 @@
 class ReekBuilder
 
   # Implementation de la construction de la tache
-  def build(project_name, auto_install, proxy_option)
+  def build(project_name, auto_install, proxy_option, file = nil)
     # On verifie la presence de reek
     Utils.verify_gem_presence(&quot;reek&quot;, auto_install, proxy_option)
     # On lance la generation
     puts &quot; Building reek report...&quot;
     files = Array.new
-    files &lt;&lt; Dir.glob(&quot;app/controllers/*.rb&quot;)
-    files &lt;&lt; Dir.glob(&quot;app/helpers/*.rb&quot;)
-    files &lt;&lt; Dir.glob(&quot;app/models/*.rb&quot;)
-    files &lt;&lt; Dir.glob(&quot;lib/**/*.rb&quot;)
-    files &lt;&lt; Dir.glob(&quot;test/**/*.rb&quot;)
-    files &lt;&lt; Dir.glob(&quot;spec/**/*.rb&quot;)
-    files.flatten!
+    if file.nil?
+      files &lt;&lt; Dir.glob(&quot;app/controllers/*.rb&quot;)
+      files &lt;&lt; Dir.glob(&quot;app/helpers/*.rb&quot;)
+      files &lt;&lt; Dir.glob(&quot;app/models/*.rb&quot;)
+      files &lt;&lt; Dir.glob(&quot;lib/**/*.rb&quot;)
+      files &lt;&lt; Dir.glob(&quot;test/**/*.rb&quot;)
+      files &lt;&lt; Dir.glob(&quot;spec/**/*.rb&quot;)
+      files.flatten!
+    else
+      files &lt;&lt; file
+    end
     reek_command = &quot;reek&quot;
     files.each do |file|
       reek_command += &quot; '#{file}'&quot;</diff>
      <filename>lib/reek_builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 # Module de fonctions utilitaires necessaire a la construction
 module Utils
 
+  WORK_DIR = &quot;tmp/continuous4r&quot;
+
   # Methode qui permet de construire une page avec eruby, et de lever une exception au besoin
   def self.erb_run page, is_a_task = true
     page_file = File.open(&quot;#{Continuous4r::WORK_DIR}/#{page}.html&quot;, &quot;w&quot;)</diff>
      <filename>lib/utils.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dd07c0066c1d73b6855aa12f46f5b4deb1838e48</id>
    </parent>
  </parents>
  <author>
    <name>Vincent Dubois</name>
    <email>vdubois@sqli-1610-2.(none)</email>
  </author>
  <url>http://github.com/vdubois/continuous4r/commit/6c33a8cc2bb7fe8ae2e18c74adade1350404b067</url>
  <id>6c33a8cc2bb7fe8ae2e18c74adade1350404b067</id>
  <committed-date>2009-10-06T04:19:43-07:00</committed-date>
  <authored-date>2009-10-06T04:19:43-07:00</authored-date>
  <message>reek analysis with html report</message>
  <tree>0a22ed6e1401e9d68c9be7d56486df7269a99ba3</tree>
  <committer>
    <name>Vincent Dubois</name>
    <email>vdubois@sqli-1610-2.(none)</email>
  </committer>
</commit>
