<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -80,7 +80,7 @@ task :feather =&gt; :environment do
   posts.each do |post|
     if post[:published]
       post.delete(:published)
-      Post.create post.merge(:slug =&gt; Post.make_slug(post[:title]))
+      Scanty::Post.create post.merge(:slug =&gt; Scanty::Post.make_slug(post[:title]))
     end
   end
 end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,88 +1,90 @@
 require 'RedCloth'
 
-class Post &lt; Sequel::Model
-  set_schema do
-    primary_key :id
-    text :title
-    text :body
-    text :slug
-    text :tags
-    timestamp :created_at
-  end
+module Scanty
+  class Post &lt; Sequel::Model
+    set_schema do
+      primary_key :id
+      text :title
+      text :body
+      text :slug
+      text :tags
+      timestamp :created_at
+    end
 
-  validates do
-   presence_of :title
-   presence_of :body
-  end
+    validates do
+      presence_of :title
+      presence_of :body
+    end
 
-  # this class method bypasses validations, so the condition
-  def self.make_slug(title)
-    title.downcase.gsub(/ /, '_').gsub(/[^a-z0-9_]/, '').squeeze('_') unless title.nil?
-  end
+    # this class method bypasses validations, so the condition
+    def self.make_slug(title)
+      title.downcase.gsub(/ /, '_').gsub(/[^a-z0-9_]/, '').squeeze('_') unless title.nil?
+    end
 
-  # returns unique non nil tags
-  # example
-  # [nil, nil, &quot;tag1,tag2&quot;, &quot;web, another&quot;, &quot;tag1, tag2&quot;,
-  #  &quot;tag1, tag2&quot;, &quot;tag, tagga&quot;]
-  # returns [&quot;tag1&quot;, &quot;tag2&quot;, &quot;web&quot;, &quot;another&quot;, &quot;tag2&quot;, &quot;tag&quot;, &quot; tagga&quot;]
-  def self.tags
-    map(:tags).compact. # nils out
-      collect { |t| t.split(',') }.flatten.uniq. # unique tags in 1-dim array
-      collect { |t| t.strip } # around spaces out
-  end
+    # returns unique non nil tags
+    # example
+    # [nil, nil, &quot;tag1,tag2&quot;, &quot;web, another&quot;, &quot;tag1, tag2&quot;,
+    #  &quot;tag1, tag2&quot;, &quot;tag, tagga&quot;]
+    # returns [&quot;tag1&quot;, &quot;tag2&quot;, &quot;web&quot;, &quot;another&quot;, &quot;tag2&quot;, &quot;tag&quot;, &quot; tagga&quot;]
+    def self.tags
+      map(:tags).compact. # nils out
+        collect { |t| t.split(',') }.flatten.uniq. # unique tags in 1-dim array
+        collect { |t| t.strip } # around spaces out
+    end
 
-  def linked_tags
-    tags.split(',').inject([]) do |accum, tag|
-      tag.strip!
-      accum &lt;&lt; &quot;&lt;a href='/past/tags/#{tag}'&gt;#{tag}&lt;/a&gt;&quot;
-    end.join('&amp;nbsp;') unless tags.nil?
-  end
+    def linked_tags
+      tags.split(',').inject([]) do |accum, tag|
+        tag.strip!
+        accum &lt;&lt; &quot;&lt;a href='/past/tags/#{tag}'&gt;#{tag}&lt;/a&gt;&quot;
+      end.join('&amp;nbsp;') unless tags.nil?
+    end
 
-  def url
-    d = created_at
-    &quot;/past/#{d.year}/#{d.month}/#{d.day}/#{slug}/&quot;
-  end
+    def url
+      d = created_at
+      &quot;/past/#{d.year}/#{d.month}/#{d.day}/#{slug}/&quot;
+    end
 
-  def full_url
-    Blog.url_base.gsub(/\/$/, '') + url
-  end
+    def full_url
+      Blog.url_base.gsub(/\/$/, '') + url
+    end
 
-  def body_html
-    to_html(body)
-  end
+    def body_html
+      to_html(body)
+    end
 
-  def summary
-    summary, more = split_content(body)
-    summary
-  end
+    def summary
+      summary, more = split_content(body)
+      summary
+    end
 
-  def summary_html
-    to_html(summary)
-  end
+    def summary_html
+      to_html(summary)
+    end
 
-  def more?
-    summary, more = split_content(body) unless body.nil?
-    more
-  end
+    def more?
+      summary, more = split_content(body) unless body.nil?
+      more
+    end
 
-  ########
-  def to_html(textile)
-    RedCloth.new(textile).to_html
-  end
+    ########
+    def to_html(textile)
+      RedCloth.new(textile).to_html
+    end
 
-  def split_content(string)
-    parts = string.gsub(/\r/, '').split(&quot;\n\n&quot;)
-    show = []
-    hide = []
-    parts.each do |part|
-      if show.join.length &lt; 100
-        show &lt;&lt; part
-      else
-        hide &lt;&lt; part
+    def split_content(string)
+      parts = string.gsub(/\r/, '').split(&quot;\n\n&quot;)
+      show = []
+      hide = []
+      parts.each do |part|
+        if show.join.length &lt; 100
+          show &lt;&lt; part
+        else
+          hide &lt;&lt; part
+        end
       end
+      [ to_html(show.join(&quot;\n\n&quot;)), hide.size &gt; 0 ]
     end
-    [ to_html(show.join(&quot;\n\n&quot;)), hide.size &gt; 0 ]
   end
 end
 
-Post.create_table unless Post.table_exists?
+Scanty::Post.create_table unless Scanty::Post.table_exists?</diff>
      <filename>lib/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -96,15 +96,15 @@ layout 'layout'
 
 get '/' do
   #FIXME doesn't this looks UNDRY?
-  @tags = Post.tags
-  posts = Post.reverse_order(:created_at).limit(10)
+  @tags = Scanty::Post.tags
+  posts = Scanty::Post.reverse_order(:created_at).limit(10)
   erb :index, :locals =&gt; { :posts =&gt; posts }
 end
 
 get '/past/:year/:month/:day/:slug/' do
   #FIXME doesn't this looks UNDRY?
-  @tags = Post.tags
-  post = Post.filter(:slug =&gt; params[:slug]).first
+  @tags = Scanty::Post.tags
+  post = Scanty::Post.filter(:slug =&gt; params[:slug]).first
   stop [ 404, &quot;Page not found&quot; ] unless post
   @title = post.title
   erb :post, :locals =&gt; { :post =&gt; post }
@@ -115,22 +115,22 @@ get '/past/:year/:month/:day/:slug' do
 end
 
 get '/past' do
-  posts = Post.reverse_order(:created_at)
+  posts = Scanty::Post.reverse_order(:created_at)
   @title = &quot;Archive&quot;
   erb :archive, :locals =&gt; { :posts =&gt; posts }
 end
 
 get '/past/tags/:tag' do
   #FIXME doesn't this looks UNDRY?
-  @tags = Post.tags
+  @tags = Scanty::Post.tags
   tag = params[:tag]
-  posts = Post.filter(:tags.like(&quot;%#{tag}%&quot;)).reverse_order(:created_at).limit(30)
+  posts = Scanty::Post.filter(:tags.like(&quot;%#{tag}%&quot;)).reverse_order(:created_at).limit(30)
   @title = &quot;Posts tagged #{tag}&quot;
   erb :tagged, :locals =&gt; { :posts =&gt; posts, :tag =&gt; tag }
 end
 
 get '/feed' do
-  @posts = Post.reverse_order(:created_at).limit(10)
+  @posts = Scanty::Post.reverse_order(:created_at).limit(10)
   content_type 'application/atom+xml', :charset =&gt; 'utf-8'
   builder :feed
 end
@@ -152,14 +152,14 @@ end
 
 get '/posts/new' do
   auth
-  erb :edit, :locals =&gt; { :post =&gt; Post.new, :url =&gt; '/posts' }
+  erb :edit, :locals =&gt; { :post =&gt; Scanty::Post.new, :url =&gt; '/posts' }
 end
 
 post '/posts' do
   auth
-  post = Post.new({ :title =&gt; params[:title], :tags =&gt; params[:tags],
+  post = Scanty::Post.new({ :title =&gt; params[:title], :tags =&gt; params[:tags],
                     :body =&gt; params[:body], :created_at =&gt; Time.now,
-                    :slug =&gt; Post.make_slug(params[:title]) })
+                    :slug =&gt; Scanty::Post.make_slug(params[:title]) })
 
   begin
     post.save
@@ -172,14 +172,14 @@ end
 
 get '/past/:year/:month/:day/:slug/edit' do
   auth
-  post = Post.filter(:slug =&gt; params[:slug]).first
+  post = Scanty::Post.filter(:slug =&gt; params[:slug]).first
   stop [ 404, &quot;Page not found&quot; ] unless post
   erb :edit, :locals =&gt; { :post =&gt; post, :url =&gt; post.url }
 end
 
 post '/past/:year/:month/:day/:slug/' do
   auth
-  post = Post.filter(:slug =&gt; params[:slug]).first
+  post = Scanty::Post.filter(:slug =&gt; params[:slug]).first
   stop [ 404, &quot;Page not found&quot; ] unless post
   post.title = params[:title]
   post.tags = params[:tags]</diff>
      <filename>main.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ Sequel.sqlite
 
 $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
 require 'post'
-Post.create_table
+Scanty::Post.create_table
 
 require 'ostruct'
 Blog = OpenStruct.new(</diff>
      <filename>spec/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
+
 require File.dirname(__FILE__) + '/base'
 
-describe Post do
+describe Scanty::Post do
   before do
-    @post = Post.new
+    @post = Scanty::Post.new
   end
 
   it &quot;has a url in simplelog format: /past/2008/10/17/my_post/&quot; do
@@ -33,13 +34,13 @@ describe Post do
     @post.title = 'hello'
     @post.body = 'world'
     @post.save
-    Post.filter(:title =&gt; 'hello').first.body.should == 'world'
+    Scanty::Post.filter(:title =&gt; 'hello').first.body.should == 'world'
   end
 
   it &quot;generates a slug from the title (but saved to db on first pass so that url never changes)&quot; do
-    Post.make_slug(&quot;RestClient 0.8&quot;).should == 'restclient_08'
-    Post.make_slug(&quot;Rushmate, rush + TextMate&quot;).should == 'rushmate_rush_textmate'
-    Post.make_slug(&quot;Object-Oriented File Manipulation&quot;).should == 'objectoriented_file_manipulation'
+    Scanty::Post.make_slug(&quot;RestClient 0.8&quot;).should == 'restclient_08'
+    Scanty::Post.make_slug(&quot;Rushmate, rush + TextMate&quot;).should == 'rushmate_rush_textmate'
+    Scanty::Post.make_slug(&quot;Object-Oriented File Manipulation&quot;).should == 'objectoriented_file_manipulation'
   end
 
   it 'returns tag list' do
@@ -50,9 +51,9 @@ describe Post do
              {:body=&gt;&quot;code&quot;, :tags=&gt;&quot;tag1, tag2&quot;, :title=&gt;&quot;all rigth&quot;},
              {:body=&gt;&quot;code&quot;, :tags=&gt;&quot;tag1, tag2&quot;, :title=&gt;&quot;all suppy rigth&quot;},
              {:body=&gt;&quot;code&quot;, :tags=&gt;&quot;tag, tagga&quot;, :title=&gt;&quot;un post de prueba&quot;} ]
-    posts.each { |p| Post.create p }
+    posts.each { |p| Scanty::Post.create p }
 
-    Post.tags.should == [&quot;tag1&quot;, &quot;tag2&quot;, &quot;web&quot;, &quot;another&quot;, &quot;tag2&quot;,
-                         &quot;tag&quot;, &quot;tagga&quot;]
+    Scanty::Post.tags.should == [&quot;tag1&quot;, &quot;tag2&quot;, &quot;web&quot;, &quot;another&quot;, &quot;tag2&quot;,
+                                 &quot;tag&quot;, &quot;tagga&quot;]
   end
 end</diff>
      <filename>spec/post_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a95d96c3c80521301c7c8882bb91ea2ddf1808de</id>
    </parent>
  </parents>
  <author>
    <name>Joaquin Rivera Padron</name>
    <email>joahking@gmail.com</email>
  </author>
  <url>http://github.com/joahking/scanty/commit/8166314edaa10492cd0f9044f988f8a995fe2212</url>
  <id>8166314edaa10492cd0f9044f988f8a995fe2212</id>
  <committed-date>2009-06-04T10:05:52-07:00</committed-date>
  <authored-date>2009-06-04T10:05:52-07:00</authored-date>
  <message>scoped post class to scanty namespace</message>
  <tree>0413f09661785fddee207fec375f4a1e4029527b</tree>
  <committer>
    <name>Joaquin Rivera Padron</name>
    <email>joahking@gmail.com</email>
  </committer>
</commit>
