<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/pomodori/display_statistics_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,11 @@
 TODAY PLANNED 12:
-- @basicmetrics new controller actions to query kirbydb and return yesterday and today pomodoros 3 =&gt; 4
-- @basicmetrics show today's pomodoros worked so far, yesterday's total in timer mode/break mode 1
+- @basicmetrics show today's pomodoros worked so far, yesterday's total in timer mode/break mode 1 =&gt; 3
 - @stopbutton I created a Stop button while on break. I just don't want to show Submit or Void. If no other better ideas, this is the only timer one can decide to interrupt the timer. 1
 - @marketing following dr.nic instructions for choc-top plus macruby embedding to packagize and possible embed macruby 8
 
-DONE:
+DONE 6:
 - @planning 1 =&gt; 1
+- @basicmetrics new controller actions to query kirbydb and return yesterday and today pomodoros 3 =&gt; 5
 
 NOT DONE:
 </diff>
      <filename>history/20090219.todo</filename>
    </modified>
    <modified>
      <diff>@@ -16,12 +16,13 @@ class Application
     @main_app = application :name =&gt; &quot;Hotcocoa&quot; do |app|
       app.delegate = self
       main_window.will_close { exit }
-      main_window &lt;&lt; input_box.disable(&quot;  ...running&quot;)
+      main_window &lt;&lt; input_box.render
       
       bottom_view &lt;&lt; countdown_field.start(POMODORO, method(:on_25_mins_done))
       bottom_view &lt;&lt; submit_button.render
       
       main_window &lt;&lt; bottom_view
+      update_metrics_for_pomodoro
     end
   end
   
@@ -55,24 +56,21 @@ class Application
   def on_click_submit_button
     @on_click_submit_button ||= Proc.new do
       pomodori_controller.create(:text =&gt; input_box.render.to_s)
-      input_box.disable(&quot;   ...break&quot;)
-      submit_button.label = &quot;Stop&quot;
+      update_metrics_for_break
       countdown_field.start(BREAK, method(:on_5_mins_done))
     end
   end
   
   def on_click_void_button
     @on_click_void_button ||= Proc.new do
-      input_box.disable(&quot;Pomodoro aborted. Break.&quot;)
-      submit_button.label = &quot;Stop&quot;
+      update_metrics_for_break
       countdown_field.start(BREAK, method(:on_5_mins_done))
     end
   end
   
   def on_5_mins_done
     ring
-    input_box.disable(&quot;   ...running&quot;)
-    submit_button.label = &quot;Void&quot;
+    update_metrics_for_pomodoro
     submit_button.action = on_click_void_button
     countdown_field.start(POMODORO, method(:on_25_mins_done))
   end
@@ -84,11 +82,29 @@ class Application
     submit_button.action = on_click_submit_button
   end
   
+  def update_metrics_for_break
+    input_box.disable(format_metrics(&quot;break&quot;))
+    submit_button.label = &quot;Stop&quot;
+  end
+  
+  def update_metrics_for_pomodoro
+    input_box.disable(format_metrics(&quot;pomodoro&quot;))
+    submit_button.label = &quot;Void&quot;
+  end
+  
   def ring
     bell = sound(
       :file =&gt; File.join(NSBundle.mainBundle.resourcePath.fileSystemRepresentation, 'bell.aif'), 
       :by_reference =&gt; true)
     bell.play if bell
   end
+  
+  private
+    
+    def format_metrics(title)
+      &quot;Now running                 #{title.upcase}\n&quot; +
+      &quot;Yesterday's pomodoros       #{pomodori_controller.yesterday_pomodoros}\n&quot; +
+      &quot;Today's pomodoros so far    #{pomodori_controller.today_pomodoros}&quot;
+    end
     
 end
\ No newline at end of file</diff>
      <filename>lib/pomodori/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ class CountdownField
     @render ||= label(:frame =&gt; @frame.to_a,
       :text =&gt; time, 
       :layout =&gt; {:expand =&gt; :width, :start =&gt; false}, 
-      :font =&gt; font(:system =&gt; 30))
+      :font =&gt; font(:name =&gt; &quot;Monaco&quot;, :size =&gt; 26))
   end
   
   private</diff>
      <filename>lib/pomodori/countdown_field.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,14 @@ class PomodoriController
     storage.save(pomodoro)
   end
   
+  def yesterday_pomodoros
+    storage.yesterday_pomodoros.size
+  end
+  
+  def today_pomodoros
+    storage.today_pomodoros.size
+  end
+  
   def storage
     @storage ||= KirbyStorage.new
   end</diff>
      <filename>lib/pomodori/pomodori_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,14 @@ class TextField
   end
   
   def render
-    @render ||= text_field(:frame =&gt; frame.to_a)
+    @render ||= text_field(:frame =&gt; frame.to_a, :font =&gt; font(:name =&gt; &quot;Monaco&quot;, :size =&gt; 11))
   end
   
   def disable(message = &quot;&quot;)
+    # FIXME: touching alignment is the only way I found
+    # to change also the rest of the properties.
     render.text_align = NSCenterTextAlignment
+    render.text_align = NSLeftTextAlignment
     render.setDrawsBackground(false)
     render.setBordered(false)
     render.setSelectable(false)
@@ -27,7 +30,6 @@ class TextField
   end
 
   def enable
-    render.text_align = NSLeftTextAlignment
     render.setDrawsBackground(true)
     render.setBordered(true)
     render.setSelectable(true)</diff>
      <filename>lib/pomodori/text_field.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,10 @@ require 'hotcocoa'
 Dir.glob(File.join(File.dirname(__FILE__), '**/*.rb')).each {|f| require f}
 
 class Application
-  POMODORO = 25 * 60
-  BREAK = 5 * 60
-  # POMODORO = 5
-  # BREAK = 3
+  # POMODORO = 25 * 60
+  # BREAK = 5 * 60
+  POMODORO = 5
+  BREAK = 3
   attr_accessor :input_box, :countdown_field, :main_window
   attr_accessor :bottom_view, :submit_button, :main_app
   attr_accessor :on_click_submit_button, :on_click_void_button
@@ -16,12 +16,13 @@ class Application
     @main_app = application :name =&gt; &quot;Hotcocoa&quot; do |app|
       app.delegate = self
       main_window.will_close { exit }
-      main_window &lt;&lt; input_box.disable(&quot;  ...running&quot;)
+      main_window &lt;&lt; input_box.render
       
       bottom_view &lt;&lt; countdown_field.start(POMODORO, method(:on_25_mins_done))
       bottom_view &lt;&lt; submit_button.render
       
       main_window &lt;&lt; bottom_view
+      update_metrics_for_pomodoro
     end
   end
   
@@ -55,24 +56,21 @@ class Application
   def on_click_submit_button
     @on_click_submit_button ||= Proc.new do
       pomodori_controller.create(:text =&gt; input_box.render.to_s)
-      input_box.disable(&quot;   ...break&quot;)
-      submit_button.label = &quot;Stop&quot;
+      update_metrics_for_break
       countdown_field.start(BREAK, method(:on_5_mins_done))
     end
   end
   
   def on_click_void_button
     @on_click_void_button ||= Proc.new do
-      input_box.disable(&quot;Pomodoro aborted. Break.&quot;)
-      submit_button.label = &quot;Stop&quot;
+      update_metrics_for_break
       countdown_field.start(BREAK, method(:on_5_mins_done))
     end
   end
   
   def on_5_mins_done
     ring
-    input_box.disable(&quot;   ...running&quot;)
-    submit_button.label = &quot;Void&quot;
+    update_metrics_for_pomodoro
     submit_button.action = on_click_void_button
     countdown_field.start(POMODORO, method(:on_25_mins_done))
   end
@@ -84,11 +82,29 @@ class Application
     submit_button.action = on_click_submit_button
   end
   
+  def update_metrics_for_break
+    input_box.disable(format_metrics(&quot;break&quot;))
+    submit_button.label = &quot;Stop&quot;
+  end
+  
+  def update_metrics_for_pomodoro
+    input_box.disable(format_metrics(&quot;pomodoro&quot;))
+    submit_button.label = &quot;Void&quot;
+  end
+  
   def ring
     bell = sound(
       :file =&gt; File.join(NSBundle.mainBundle.resourcePath.fileSystemRepresentation, 'bell.aif'), 
       :by_reference =&gt; true)
     bell.play if bell
   end
+  
+  private
+    
+    def format_metrics(title)
+      &quot;Now running                 #{title.upcase}\n&quot; +
+      &quot;Yesterday's pomodoros       #{pomodori_controller.yesterday_pomodoros}\n&quot; +
+      &quot;Today's pomodoros so far    #{pomodori_controller.today_pomodoros}&quot;
+    end
     
 end
\ No newline at end of file</diff>
      <filename>pomodori.app/Contents/Resources/lib/pomodori/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ class CountdownField
     @render ||= label(:frame =&gt; @frame.to_a,
       :text =&gt; time, 
       :layout =&gt; {:expand =&gt; :width, :start =&gt; false}, 
-      :font =&gt; font(:system =&gt; 30))
+      :font =&gt; font(:name =&gt; &quot;Monaco&quot;, :size =&gt; 26))
   end
   
   private</diff>
      <filename>pomodori.app/Contents/Resources/lib/pomodori/countdown_field.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,14 @@ class PomodoriController
     storage.save(pomodoro)
   end
   
+  def yesterday_pomodoros
+    storage.yesterday_pomodoros.size
+  end
+  
+  def today_pomodoros
+    storage.today_pomodoros.size
+  end
+  
   def storage
     @storage ||= KirbyStorage.new
   end</diff>
      <filename>pomodori.app/Contents/Resources/lib/pomodori/pomodori_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,11 +13,14 @@ class TextField
   end
   
   def render
-    @render ||= text_field(:frame =&gt; frame.to_a)
+    @render ||= text_field(:frame =&gt; frame.to_a, :font =&gt; font(:name =&gt; &quot;Monaco&quot;, :size =&gt; 11))
   end
   
   def disable(message = &quot;&quot;)
+    # FIXME: touching alignment is the only way I found
+    # to change also the rest of the properties.
     render.text_align = NSCenterTextAlignment
+    render.text_align = NSLeftTextAlignment
     render.setDrawsBackground(false)
     render.setBordered(false)
     render.setSelectable(false)
@@ -27,7 +30,6 @@ class TextField
   end
 
   def enable
-    render.text_align = NSLeftTextAlignment
     render.setDrawsBackground(true)
     render.setBordered(true)
     render.setSelectable(true)</diff>
      <filename>pomodori.app/Contents/Resources/lib/pomodori/text_field.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 #!/bin/bash
 echo &quot;Loading Pomodori Interactive Console&quot;
-macirb --simple-prompt script/init.rb
\ No newline at end of file
+macirb -r script/init.rb --simple-prompt
\ No newline at end of file</diff>
      <filename>script/console</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,7 @@ class AllTests
     suite &lt;&lt; ApplicationTest.suite
     suite &lt;&lt; On25MinsTimerTest.suite
     suite &lt;&lt; OnClickTheSubmitButtonTest.suite
+    suite &lt;&lt; DisplayStatisticsTest.suite
     return suite
   end
 end</diff>
      <filename>test/all_tests.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,6 @@ class KirbyStorageTest &lt; Test::Unit::TestCase
     @path = File.dirname(__FILE__) + &quot;/../work&quot;
     create_db(@path)
     @kirby_storage = KirbyStorage.new(@path)
-    Time.stubs(:now).returns(Time.local(2009, &quot;feb&quot;, 18, &quot;5&quot;, &quot;25&quot;))
   end
   
   def test_retrieves_table_for_instances_or_class
@@ -33,16 +32,6 @@ class KirbyStorageTest &lt; Test::Unit::TestCase
     assert_equal(5, @kirby_storage.find_all_by_date(Pomodoro, date).size)
   end
   
-  def test_returns_all_yesterdays_pomodoros
-    bulk_import_test_data
-    assert_equal(10, @kirby_storage.yesterday_pomodoros.size)
-  end
-  
-  def test_returns_all_todays_pomodoros
-    bulk_import_test_data
-    assert_equal(6, @kirby_storage.today_pomodoros.size)
-  end
-  
   def teardown
     wipe_dir(@path)
   end</diff>
      <filename>test/pomodori/kirby_storage_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ class OnClickTheSubmitButtonTest &lt; Test::Unit::TestCase
 
   def setup
     @application = Application.new
+    @application.stubs(:update_metrics_for_break)
   end
 
   def test_it_starts_the_break
@@ -21,14 +22,4 @@ class OnClickTheSubmitButtonTest &lt; Test::Unit::TestCase
     @application.on_click_submit_button.call
   end
   
-  # def test_changes_label_to_break
-  #   @application.on_click_submit_button.call
-  #   assert_equal(&quot;   ...break&quot;, @application.input_box.render.to_s)
-  # end
-  
-  # def test_changes_button_to_stop
-  #   @application.on_click_submit_button.call
-  #   assert_equal(&quot;Stop&quot;, @application.submit_button.render.title)
-  # end
-
 end
\ No newline at end of file</diff>
      <filename>test/pomodori/on_click_the_submit_button_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f029222ccb0a6df5ed7b26c9637fc46176f8666a</id>
    </parent>
  </parents>
  <author>
    <name>reborg</name>
    <email>reborg@reborg.net</email>
  </author>
  <url>http://github.com/reborg/pomodori/commit/4c51bbb277c50ef05076d1de03dfc9b989113fff</url>
  <id>4c51bbb277c50ef05076d1de03dfc9b989113fff</id>
  <committed-date>2009-02-19T13:05:59-08:00</committed-date>
  <authored-date>2009-02-19T13:05:59-08:00</authored-date>
  <message>Simple statistics implemented and displayed while the pomodoro is running and during the break.</message>
  <tree>0cfdb4988a2539c24900da08e0a8b151f21a026c</tree>
  <committer>
    <name>reborg</name>
    <email>reborg@reborg.net</email>
  </committer>
</commit>
