<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/tweet-tail/html_tweet_formatter.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
-* configurable output format [gaustin]
+* configurable output format with formatter class [gaustin]
+* configurable output format with optional block [gaustin]
 * colour highlighting [bcarlso]
 * dependency on json gem
 * explicit development dependencies</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -12,4 +12,6 @@ require &quot;open-uri&quot;
 
 require &quot;tweet-tail/tweet_poller&quot;
 
-require &quot;tweet-tail/ansi_tweet_formatter&quot;
\ No newline at end of file
+require &quot;tweet-tail/ansi_tweet_formatter&quot;
+
+require &quot;tweet-tail/html_tweet_formatter&quot;
\ No newline at end of file</diff>
      <filename>lib/tweet-tail.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require 'optparse'
 
 module TweetTail::CLI
   def self.execute(stdout, arguments=[])
-    options = { :polling =&gt; false }
+    options = { :polling =&gt; false, :html =&gt; false }
     
     parser = OptionParser.new do |opts|
       opts.banner = &lt;&lt;-BANNER.gsub(/^          /,'')
@@ -17,6 +17,7 @@ module TweetTail::CLI
               ) { |arg| options[:polling] = true }
       opts.on(&quot;-h&quot;, &quot;--help&quot;,
               &quot;Show this help message.&quot;) { stdout.puts opts; exit }
+      opts.on(&quot;--html&quot;, &quot;output html&quot;) { |arg| options[:html] = true }
       opts.parse!(arguments)
     end
     
@@ -30,12 +31,20 @@ module TweetTail::CLI
       app.extend(TweetTail::AnsiTweetFormatter) if stdout.tty?
       
       app.refresh
-      stdout.puts app.render_latest_results
+      if options[:html]
+        stdout.puts app.render_latest_results(TweetTail::HtmlTweetFormatter)
+      else
+        stdout.puts app.render_latest_results(nil)
+      end
       while(options[:polling])
         Kernel::sleep(15)
         app.refresh
         if app.render_latest_results.size &gt; 0
-          stdout.puts app.render_latest_results
+          if options[:html]
+            stdout.puts app.render_latest_results(TweetTail::HtmlTweetFormatter)
+          else
+            stdout.puts app.render_latest_results(nil)
+          end
         end
       end
     rescue Interrupt</diff>
      <filename>lib/tweet-tail/cli.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,13 +19,15 @@ class TweetTail::TweetPoller
     @refresh_url    = @latest_feed[&quot;refresh_url&quot;]
   end
   
-  def render_latest_results(&amp;block)
+  def render_latest_results(formatter, &amp;block)
     format_block = block unless block.nil?
     @latest_results.inject(&quot;&quot;) do |output, tweet|
-      if block.nil? 
+      if formatter.nil? &amp;&amp; block.nil?
         output += format(tweet)
-      else
+      elsif formatter.nil?
         output += block.call(tweet)
+      else
+        output += formatter.format(tweet)
       end
     end
   end</diff>
      <filename>lib/tweet-tail/tweet_poller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,17 +48,17 @@ class TestTweetPoller &lt; Test::Unit::TestCase
     theRMK: Come speak with Matt at JAOO next week
     drnic: reading my own abstract for JAOO presentation
     RESULTS
-    assert_equal(expected, @app.render_latest_results)
+    assert_equal(expected, @app.render_latest_results(nil))
   end
   
-  def test_message_render_html
+  def test_message_render_html_block
     expected = &lt;&lt;-RESULTS.gsub(/^    /, '')
     &lt;div class='tweet'&gt;\nmattnhodges: Come speak with me at JAOO next week - http://jaoo.dk/&lt;br /&gt;\n&lt;a href='http://not.in.google/'&gt;10:01 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
     &lt;div class='tweet'&gt;\nSteve_Hayes: @VenessaP I think they went out for noodles. #jaoo&lt;br /&gt;\n&lt;a href='http://not.in.google/'&gt;10:01 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
     &lt;div class='tweet'&gt;\ntheRMK: Come speak with Matt at JAOO next week&lt;br /&gt;\n&lt;a href='http://twitter.com/theRMK/statuses/1666334207'&gt;10:01 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
     &lt;div class='tweet'&gt;\ndrnic: reading my own abstract for JAOO presentation&lt;br /&gt;\n&lt;a href='https://twitter.com/drnic/status/1666627310'&gt;10:45 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
     RESULTS
-    actual = @app.render_latest_results do |tweet|
+    actual = @app.render_latest_results(nil) do |tweet|
       screen_name = tweet['from_user']
       created_at = tweet['created_at']
       link = tweet['source']
@@ -68,6 +68,17 @@ class TestTweetPoller &lt; Test::Unit::TestCase
     assert_equal(expected, actual)
   end
   
+  def test_message_render_html_formatter
+    expected = &lt;&lt;-RESULTS.gsub(/^    /, '')
+    &lt;div class='tweet'&gt;\nmattnhodges: Come speak with me at JAOO next week - http://jaoo.dk/&lt;br /&gt;\n&lt;a href='http://not.in.google/'&gt;10:01 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
+    &lt;div class='tweet'&gt;\nSteve_Hayes: @VenessaP I think they went out for noodles. #jaoo&lt;br /&gt;\n&lt;a href='http://not.in.google/'&gt;10:01 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
+    &lt;div class='tweet'&gt;\ntheRMK: Come speak with Matt at JAOO next week&lt;br /&gt;\n&lt;a href='http://twitter.com/theRMK/statuses/1666334207'&gt;10:01 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
+    &lt;div class='tweet'&gt;\ndrnic: reading my own abstract for JAOO presentation&lt;br /&gt;\n&lt;a href='https://twitter.com/drnic/status/1666627310'&gt;10:45 PM Apr 30th&lt;/a&gt;\n&lt;/div&gt;
+    RESULTS
+    actual = @app.render_latest_results(TweetTail::HtmlTweetFormatter)
+    assert_equal(expected, actual)
+  end
+  
   def test_ready_for_refresh
     assert_equal('?since_id=1682666650&amp;q=jaoo', @app.refresh_url)
   end
@@ -87,7 +98,7 @@ class TestTweetPoller &lt; Test::Unit::TestCase
     expected = &lt;&lt;-RESULTS.gsub(/^    /, '')
     CaioProiete: Wish I could be at #JAOO Australia...
     RESULTS
-    assert_equal(expected, @app.render_latest_results)
+    assert_equal(expected, @app.render_latest_results(nil))
     assert_equal('?since_id=1711269079&amp;q=jaoo', @app.refresh_url)
   end
 end</diff>
      <filename>test/test_tweet_poller.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7c9b243ae0132ed72d4e472c6180f18201ebd2af</id>
    </parent>
  </parents>
  <author>
    <name>gaustin</name>
    <email>gaustin@gmail.com</email>
  </author>
  <url>http://github.com/gaustin/tweet-tail/commit/cead8708ea02676748553daec8ae6b284990a34f</url>
  <id>cead8708ea02676748553daec8ae6b284990a34f</id>
  <committed-date>2009-06-07T10:06:38-07:00</committed-date>
  <authored-date>2009-06-07T10:06:38-07:00</authored-date>
  <message>Added formatter  class and test for html format.
Added command line option for HTML format.</message>
  <tree>89ce604e6ee4d90323488fc1f6a4f9948f28f363</tree>
  <committer>
    <name>gaustin</name>
    <email>gaustin@gmail.com</email>
  </committer>
</commit>
