<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-Copyright (c) 2008 [name of plugin creator]
+Copyright (c) 2008 James Chan
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the</diff>
      <filename>MIT-LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,39 @@
 MetaOnRails
 ===========
 
-
 MetaOnRails DRYs up your page meta tags.
-todo
+
+It is a very simple plugin to help you customize your pages' meta tags a little bit easier.
+
+How to Install
+======
+./script/plugin install git://github.com/ashchan/meta_on_rails.git
+
 
 Example
 =======
+Add the following code to the layout (e.g. app/views/layout/application.html.erb), be sure to put it in the head tag:
+
+&lt;head&gt;
+&lt;%= display_meta(:keywords =&gt; &quot;default,keywords&quot;, :description =&gt; &quot;default description&quot;) %&gt;
+&lt;/head&gt;
+
+Default meta values can be set. In the above example, these two meta tags will be generated if they're not override on the views:
 
-todo
+&lt;meta name=&quot;description&quot; content=&quot;default description&quot; /&gt;
+&lt;meta name=&quot;keywords&quot; content=&quot;default,keywords&quot; /&gt;
 
+Then add this code to the view to set meta tags on that page:
+
+&lt;% set_meta(:keywords =&gt; 'my,keyword', :generator =&gt; 'a bad &lt;script /&gt; generator') %&gt;
+
+The output html will be like this:
+
+&lt;meta name=&quot;generator&quot; content=&quot;a bad  generator&quot; /&gt;
+&lt;meta name=&quot;description&quot; content=&quot;default description&quot; /&gt;
+&lt;meta name=&quot;keywords&quot; content=&quot;my,keyword&quot; /&gt;
+
+
+=======
 
 Copyright (c) 2008 James Chan (ashchan), released under the MIT license</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-# Include hook code here
+ActionView::Base.send :include, MetaOnRails</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,21 @@
-# MetaOnRails
+module MetaOnRails
+  
+  def set_meta(meta = {})
+    @meta = meta
+  end
+  
+  def display_meta(default = {})
+    @meta ||= {}
+    #@meta.reverse_merge!(default)
+    @meta = default.merge(@meta)
+    @meta.map do |m|
+      &quot;&lt;meta name=\&quot;#{m[0]}\&quot; content=\&quot;#{normalize(m[1])}\&quot; /&gt;&quot;
+    end.join(&quot;\n&quot;)
+  end
+  
+  private
+  def normalize(s)
+    s.gsub(/&lt;\/?[^&gt;]*&gt;/, '')
+  end
+  
+end</diff>
      <filename>lib/meta_on_rails.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,24 @@
 require 'test/unit'
+require File.dirname(__FILE__) + '/../lib/meta_on_rails'
 
 class MetaOnRailsTest &lt; Test::Unit::TestCase
-  # Replace this with your real tests.
-  def test_this_plugin
-    flunk
+  include MetaOnRails
+  
+  def test_should_have_default_values
+    output = display_meta(:keywords =&gt; 'default')
+    assert output.include?(&quot;&lt;meta name=\&quot;keywords\&quot; content=\&quot;default\&quot;&quot;)
+  end
+  
+  def test_should_strip_html
+    set_meta(:keywords =&gt; '&lt;bong&gt;aword&lt;/bong&gt;')
+    output = display_meta
+    assert !output.include?(&quot;&lt;bong&gt;&quot;)
+    assert output.include?(&quot;aword&quot;)
+  end
+  
+  def test_should_override_default_values
+    set_meta(:keywords =&gt; 'override')
+    output = display_meta(:keywords =&gt; 'default')
+    assert output.include?('override')
   end
 end</diff>
      <filename>test/meta_on_rails_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6b2e770862e07fc9c930ab718f9e541c416c1fa3</id>
    </parent>
  </parents>
  <author>
    <name>ashchan</name>
    <email>ashchan@gmail.com</email>
  </author>
  <url>http://github.com/ashchan/meta_on_rails/commit/b96c9ba8e64df539e085d8b10982aee102f75af1</url>
  <id>b96c9ba8e64df539e085d8b10982aee102f75af1</id>
  <committed-date>2008-06-25T02:10:35-07:00</committed-date>
  <authored-date>2008-06-25T02:10:35-07:00</authored-date>
  <message>finished basic logic [#1 state:resolved]</message>
  <tree>13f9ec66b3f7729b6c1d5dd64c041db74cee26ae</tree>
  <committer>
    <name>ashchan</name>
    <email>ashchan@gmail.com</email>
  </committer>
</commit>
