<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/honk/app.rb</filename>
    </added>
    <added>
      <filename>lib/honk/helpers.rb</filename>
    </added>
    <added>
      <filename>lib/honk/skel/honk.ru</filename>
    </added>
    <added>
      <filename>lib/honk/skel/public/master.css</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/archive.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/atom.builder</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/error.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/footer.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/header.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/index.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/layout.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/not_found.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/post.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/rss.builder</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/tag.haml</filename>
    </added>
    <added>
      <filename>lib/honk/skel/templates/tags.haml</filename>
    </added>
    <added>
      <filename>lib/honk/tagging.rb</filename>
    </added>
    <added>
      <filename>spec/app_spec.rb</filename>
    </added>
    <added>
      <filename>spec/mock/public</filename>
    </added>
    <added>
      <filename>spec/mock/templates</filename>
    </added>
    <added>
      <filename>spec/tagging_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,26 +1,30 @@
-require 'pathname'
-require 'yaml'
-require 'date'
-require 'metash'
+%w[pathname yaml date metash sinatra/base haml mime/types].each do |lib|
+  require lib
+end
 
 class Pathname; alias / join; end
 
 Infinity = 1/0.0
 
 module Honk
+  PATH = Pathname.new(__FILE__).dirname
 
-  class IndexError &lt; StandardError; end
+  class IndexError    &lt; StandardError; end
+  class NoTagError    &lt; StandardError; end
+  class NoPostError   &lt; StandardError; end
+  class SecurityError &lt; StandardError; end
 
   DEFAULT_OPTIONS = [
-    :root, :paginate, :comment_hook, :comment_filter, :meta, :language
+    :root, :paginate, :comment_hook, :comment_filter, :meta, :time_format
   ]
 
   DEFAULTS = lambda {
-    root           Pathname.new('.').expand_path
+    root           PATH / 'honk' / 'skel'
     paginate       10
     language       :en
     comment_hook   lambda {|p,c| }
     comment_filter lambda {|s| s }
+    time_format    '%c'
     meta           _={
       :author      =&gt; &quot;Honk default author&quot;,
       :title       =&gt; &quot;Honk&quot;,
@@ -33,6 +37,8 @@ module Honk
   @@options = Metash.new
   @@options.instance_eval(&amp;DEFAULTS)
 
+  @@index, @@tags = nil, nil
+
   def self.setup(&amp;blk)
     @@options.instance_eval(&amp;blk)
   end
@@ -41,6 +47,14 @@ module Honk
     @@options
   end
 
+  def self.load!
+    @@index = YAML.load_file(options.root / 'index.yml')
+    @@tags  = YAML.load_file(options.root / 'tags.yml')
+  end
+
+  def self.index; @@index; end
+  def self.tags;  @@tags;  end
+
   def self.check_options
     validity = true
     messages = {}
@@ -109,6 +123,6 @@ module Honk
 
 end
 
-%w[post comment index tag].each do |lib|
-  require Pathname.new(__FILE__).dirname / 'honk' / lib
+%w[post comment index tagging helpers].each do |lib|
+  require Honk::PATH / 'honk' / lib
 end</diff>
      <filename>lib/honk.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,10 @@ module Honk
       %w[@title @tags @timestamp @commentable @abstract @contents]
     end
 
+    def formatted_timestamp
+      @timestamp.strftime Honk.options.time_format
+    end
+
     def to_yaml(opts)
       YAML.quick_emit(object_id, opts) do |out|
         out.map(taguri, to_yaml_style) do |map|</diff>
      <filename>lib/honk/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,7 @@ def reset_honk
   Honk.setup &amp;Honk::DEFAULTS
   Honk.setup {
     root Pathname.new(__FILE__).dirname / 'mock'
+    paginate 1
   }
 end
 </diff>
      <filename>spec/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,13 @@ describe 'Honk' do
     @defaults.instance_eval &amp;Honk::DEFAULTS
   end
 
+  it 'has @@index end @@tags' do
+    Honk.load!
+
+    Honk.index.should.be.kind_of Honk::Index
+    Honk.tags.should.be.kind_of  Honk::Tagging
+  end
+
   describe 'Options' do
     should 'be accessible with the .options method' do
       Honk.options.should.be.kind_of Metash</diff>
      <filename>spec/honk_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -85,7 +85,7 @@ describe Honk::Index do
 
     describe &quot;.pages()&quot; do
       it &quot;should return the number of pages&quot; do
-        @index.pages.should == 10
+        @index.pages.should == 100
       end
     end
 
@@ -93,7 +93,7 @@ describe Honk::Index do
       it 'should return all the posts for a given page' do
         page = @index.page(0)
         page.first.should == {'post0' =&gt; 'post0.yml'}
-        page.last.should  == {'post9' =&gt; 'post9.yml'}
+        page.last.should  == {'post0' =&gt; 'post0.yml'}
       end
 
       it 'should return all posts for page(0) when paginate is infinity' do</diff>
      <filename>spec/index_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 --- !honk.yapok.org,2009/Post
-:title: A sample post
+:title: Another post
 :tags:
   - foo
   - bar
 :timestamp: 2009-01-27T21:42:21+01:00
 :commentable: true
 :contents: |-
-  &lt;p&gt;This is a post&lt;/p&gt;
+  &lt;p&gt;This is another post&lt;/p&gt;</diff>
      <filename>spec/mock/posts/basic_sample.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
---- !honk.yapok.org,2009/Tags
+--- !honk.yapok.org,2009/Tagging
 foo:
   - sample
   - short_sample</diff>
      <filename>spec/mock/tags.yml</filename>
    </modified>
    <modified>
      <diff>@@ -122,4 +122,11 @@ describe Honk::Post do
     end
   end
 
+  describe 'formatted_timestamp' do
+    it 'returns the timestamp formatted with Honk.options.time_format' do
+      @post = Honk::Post.open('sample', 'basic_sample.yml')
+      @post.formatted_timestamp.
+        should == @post.timestamp.strftime(Honk.options.time_format)
+    end
+  end
 end</diff>
      <filename>spec/post_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>config.rb</filename>
    </removed>
    <removed>
      <filename>css/master.css</filename>
    </removed>
    <removed>
      <filename>honk.rb</filename>
    </removed>
    <removed>
      <filename>lib/honk/tag.rb</filename>
    </removed>
    <removed>
      <filename>spec/tag_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>b8b5b2ff4c6e65ed31b7ab7042ace48d69f67a39</id>
    </parent>
  </parents>
  <author>
    <name>madx</name>
    <email>root@yapok.org</email>
  </author>
  <url>http://github.com/madx/honk/commit/7d91f94dd60c46947b2fa7e19cdd43b9a91a6e39</url>
  <id>7d91f94dd60c46947b2fa7e19cdd43b9a91a6e39</id>
  <committed-date>2009-07-06T14:41:06-07:00</committed-date>
  <authored-date>2009-07-06T12:21:34-07:00</authored-date>
  <message>MASSIVE refactoring - please do not update your blogs yet

This is the refactoring I've been working on. Honk is now a modular Sinatra app
that runs with rackup. Some parts are still missing (notably the comment
posting), and there may be bugs. I hope this version will be more usable, and
that it will play nice with other Rack apps.

*Please, do not use versions up from this one until further notice! They are
prone to bugs and many things are missing.*</message>
  <tree>ac58a93b743057dbc372068e21995bbea63cb357</tree>
  <committer>
    <name>madx</name>
    <email>root@yapok.org</email>
  </committer>
</commit>
